0
点赞
收藏
分享

微信扫一扫

让应用程序重新回到源程序

雨鸣静声 2023-06-21 阅读 54

List<ActivityManager.RunningTaskInfo> allTasks = activityManager.getRunningTasks(30);



for (ActivityManager.RunningTaskInfo aTask : allTasks) { Intent i = new Intent(Intent.ACTION_MAIN); i.setComponent(aTask.baseActivity); (...)


intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_REORDER_TO_FRONT.).addCategory(Intent.CATEGORY_LAUNCHER);

   monthis.startActivity(intent);




intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK| Intent.FLAG_ACTIVITY_REORDER_TO_FRONT.)


这个可以让活动重新回到原来的状态如我写一个an email, press home and go into my activity,launch email, and then the app launch the email bout goes back at the inbox and the email is lost


摘录


 


举报

相关推荐

0 条评论