[英]Bring application to foreground same as Pressing the application in the recent activity?
与用户在“ 最近活动”活动中按应用程序图标/图像时一样,我该如何使应用程序回到前台。
You just do what Android does when the user presses the application icon/image: 您只需执行用户按下应用程序图标/图像时Android的操作即可:
Intent intent = new Intent(context, MyRootActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Make sure that you specify the root activity of your application (ie: the one with ACTION=MAIN and CATEGORY=LAUNCHER). 确保指定应用程序的根活动(即:具有ACTION = MAIN和CATEGORY = LAUNCHER的活动)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.