且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何知道我的应用程序是开放的,当我设法推送通知

更新时间:2021-08-24 01:28:33

启动根系活力(一个具有ACTION = MAIN和类别= LAUNCHER在清单),并添加 Intent.FLAG_ACTIVITY_NEW_TASK 。如果应用程序已经处于活动状态(无论哪个活动是顶部),这将只是把任务前面。如果应用程序未激活,它会启动它与您的根系活力。

Launch the root activity (the one that has ACTION=MAIN and CATEGORY=LAUNCHER in the manifest) and add Intent.FLAG_ACTIVITY_NEW_TASK. If the app is already active (no matter which activity is on top) this will just bring the task to the front. If the app isn't active, it will start it with your root activity.