开发者

Widget launching a second instance of application - different activities

After reading more than 30 articles and testing more than 15 suggested solutions - i came out empty and my problem persists.

My problem is very similar to the issue discussed in: Widget launching a second instance of application

I have activity A - the launcher activity . A launches activity B for result. User clicks home button - than starts the application from a widget (the widget launches activity A). The user get the A activity, clicks back , gets B activity , clicks another back get A again with different data - since B returned its result. What i really want is that the widget will not launch a new instanc开发者_如何学JAVAe for Activity A - I would want it to identify Activity A already activity and start it (in the case i described its the chain A==>B).

Already tried All the flags(4) in PendingIntent.getActivity. I tried flagging the B launch with Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP

And put in my manifest "allowtaskreparenting" for the application and paramter android:launchMode="singleTop" in Activity A.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜