本文整理匯總了Java中android.app.Application.startActivity方法的典型用法代碼示例。如果您正苦於以下問題:Java Application.startActivity方法的具體用法?Java Application.startActivity怎麽用?Java Application.startActivity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.app.Application
的用法示例。
在下文中一共展示了Application.startActivity方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import android.app.Application; //導入方法依賴的package包/類
/**
* init in your application onCreate()
*
* @param app your application
* @param debug your app module BuildConfig.DEBUG
*/
public static void init(Application app, boolean debug) {
if (!debug) {
return;
}
if (Build.VERSION.SDK_INT >= 23 && !Settings.canDrawOverlays(app)) {
Intent intent = new Intent(app, RequestOverlayActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
app.startActivity(intent);
} else {
addWindow(app);
}
}
示例2: openLauncher
import android.app.Application; //導入方法依賴的package包/類
public static void openLauncher(Application app, Class aClass) {
Intent intent = new Intent(app, aClass);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_CLEAR_TASK
| Intent.FLAG_ACTIVITY_NEW_TASK);
app.startActivity(intent);
android.os.Process.killProcess(android.os.Process.myPid());
}
示例3: openRemoteActivity
import android.app.Application; //導入方法依賴的package包/類
@RouterPath("/openRemoteActivity")
public void openRemoteActivity(Application context, String scheme, VPromise promise) {
Intent intent = new Intent(context, RemoteActivity.class);
intent.putExtra("tag", promise.getTag());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
示例4: openLocalActivity
import android.app.Application; //導入方法依賴的package包/類
/**
* Route => android://main/activity/localActivity
*/
@RouterPath("/activity/localActivity")
public void openLocalActivity(Application context, VPromise promise) {
String tag = promise.getTag();
Intent intent = new Intent(context, LocalActivity.class);
intent.putExtra("tag", tag);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}