首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

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

2012-09-25 
让应用程序重新回到源程序ListActivityManager.RunningTaskInfo allTasks activityManager.getRunning

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

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

摘录

?

热点排行