本文整理了Java中android.app.Activity.startActivity()
方法的一些代码示例,展示了Activity.startActivity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.startActivity()
方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:startActivity
暂无
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到详情播放
*
* @param activity
*/
public static void goToScrollWindow(Activity activity) {
Intent intent = new Intent(activity, WindowActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到带广告的
*
* @param activity
*/
public static void goToVideoADPlayer2(Activity activity) {
Intent intent = new Intent(activity, DetailADPlayer2.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到详情播放
*
* @param activity
*/
public static void goToScrollDetailPlayer(Activity activity) {
Intent intent = new Intent(activity, ScrollingActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到详情播放
*
* @param activity
*/
public static void goToDetailListPlayer(Activity activity) {
Intent intent = new Intent(activity, DetailListPlayer.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到弹幕
*
* @param activity
*/
public static void gotoDanmaku(Activity activity) {
Intent intent = new Intent(activity, DanmkuVideoActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳到可控制
*
* @param activity
*/
public static void gotoControl(Activity activity) {
Intent intent = new Intent(activity, DetailControlActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到AD详情播放
*
* @param activity
*/
public static void goToVideoADPlayer(Activity activity) {
Intent intent = new Intent(activity, DetailADPlayer.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到Fragment
*
* @param activity
*/
public static void gotoFragment(Activity activity) {
Intent intent = new Intent(activity, FragmentVideoActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳到多类型
*
* @param activity
*/
public static void gotoMoreType(Activity activity) {
Intent intent = new Intent(activity, DetailMoreTypeActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到详情播放
*
* @param activity
*/
public static void gotoWebDetail(Activity activity) {
Intent intent = new Intent(activity, WebDetailActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳到可输入
*
* @param activity
*/
public static void gotoInput(Activity activity) {
Intent intent = new Intent(activity, InputUrlDetailActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: square/picasso
public void launch(Activity activity) {
activity.startActivity(new Intent(activity, activityClass));
activity.finish();
}
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到详情播放
*
* @param activity
*/
public static void goToDetailPlayer(Activity activity) {
Intent intent = new Intent(activity, DetailPlayer.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳转到详情播放
*
* @param activity
*/
public static void goToDetailExoListPlayer(Activity activity) {
Intent intent = new Intent(activity, DetailExoListPlayer.class);
activity.startActivity(intent);
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
/**
* 跳到滤镜
*
* @param activity
*/
public static void gotoFilter(Activity activity) {
Intent intent = new Intent(activity, DetailFilterActivity.class);
activity.startActivity(intent);
}
代码示例来源:origin: JessYanCoding/MVPArms
/**
* 跳转界面 3
*
* @param activity
* @param homeActivityClass
*/
public static void startActivity(Activity activity, Class homeActivityClass) {
Intent intent = new Intent(activity.getApplicationContext(), homeActivityClass);
activity.startActivity(intent);
}
代码示例来源:origin: stackoverflow.com
public class JavaScriptInterface {
private Activity activity;
public JavaScriptInterface(Activity activiy) {
this.activity = activiy;
}
public void startVideo(String videoAddress){
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(videoAddress), "video/3gpp");
activity.startActivity(intent);
}
}
代码示例来源:origin: stackoverflow.com
public static void startInstalledAppDetailsActivity(final Activity context) {
if (context == null) {
return;
}
final Intent i = new Intent();
i.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
i.addCategory(Intent.CATEGORY_DEFAULT);
i.setData(Uri.parse("package:" + context.getPackageName()));
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
i.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
i.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
context.startActivity(i);
}
代码示例来源:origin: bumptech/glide
@Override
public void onClick(View view) {
ClipboardManager clipboard =
(ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip =
ClipData.newPlainText("giphy_url", result.images.fixed_height.url);
Preconditions.checkNotNull(clipboard).setPrimaryClip(clip);
Intent fullscreenIntent = FullscreenActivity.getIntent(activity, result);
activity.startActivity(fullscreenIntent);
}
});
代码示例来源:origin: robolectric/robolectric
@Test
public void shouldUseAnimationOverride() {
Activity activity = Robolectric.setupActivity(Activity.class);
Intent intent = new Intent(activity, OptionsMenuActivity.class);
Bundle animationBundle = ActivityOptions.makeCustomAnimation(activity, R.anim.test_anim_1, R.anim.test_anim_1).toBundle();
activity.startActivity(intent, animationBundle);
assertThat(shadowOf(activity).getNextStartedActivityForResult().options).isSameAs(animationBundle);
}
内容来源于网络,如有侵权,请联系作者删除!