## Android啟動第三方APK
阿新 • • 發佈:2018-12-11
1.通過包名啟動APP
var intent = BaseApplication.mContext.packageManager.getLaunchIntentForPackage(packageName)
if (intent != null) {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
BaseApplication.mContext.startActivity(intent)
}
2.通過包名和Activity名開啟APP指定的Activity
var intent = Intent() intent.setClassName(“包名”, “Activity全名【包名.Activity名】”) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK BaseApplication.mContext.startActivity(intent)
Kotlin技術專欄