开发者

How to reopen a stack of Activities?

开发者 https://www.devze.com 2023-01-14 03:29 出处:网络
my App is Launched by \"Main.java\" (Activity) and opens a Notification and a second Activity called \"Sub.java\", now I press the Home-Button and the App disapears (everything okay until here).

my App is Launched by "Main.java" (Activity) and opens a Notification and a second Activity called "Sub.java", now I press the Home-Button and the App disapears (everything okay until here).

If I'll now click on the Notification the "Main.java"-Activity is launched, the "Sub.java" seems to be lost. Is there any 开发者_如何学运维posibility to reorder the Stack of Activities to the front?

Thanks a lot for any answer.

Example of my Problem is found here: entire eclipse project: http://files.foxylion.de/android/problems/sample1.zip


Solved the problem after googling for a long time ;)

Adding

notificationIntent.setAction("android.intent.action.MAIN");
notificationIntent.addCategory("android.intent.category.LAUNCHER");

to the notification-intent will prevent the task from beeing always restarted.

The hint to the solution i found in the logs startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent ..., after googling the solution was on this site: http://www.mail-archive.com/android-developers@googlegroups.com/msg19285.html

0

精彩评论

暂无评论...
验证码 换一张
取 消