应用回到前台:如果应用在后台,则调用该方法回到前台;如果应用在前台调用该方法则无任何作用。
fun startAPP(context: Context, appPackageName: String) {
try {
val intent: Intent = context.packageManager.getLaunchIntentForPackage(appPackageName)
context.startActivity(intent)
} catch (e: Exception) {
Log.d(TAG, "e:$e")
}
}