【发布时间】:2018-04-25 08:43:25
【问题描述】:
我有一个简单的 Android 应用程序需要在特定条件下启动另一个应用程序,我需要在应用程序启动时检查条件。也就是说,要么继续启动我的应用程序,要么只启动另一个应用程序:
if (A == true) {
launch another activity of another app
leave the current app without creating the main activity
} else {
launch the main activity of the current app
}
谁能告诉我如何处理 A == true case?我能够启动另一个应用程序的 Activity,但我什至在不打开主 Activity 的情况下离开当前应用程序时遇到了麻烦。
任何帮助将不胜感激!
【问题讨论】:
-
尝试在 onCreate 中的 setContentView 之前添加此代码
标签: android android-activity launch