开发者

How do i retrieve a particular instance of the same activity in the back stack?

开发者 https://www.devze.com 2023-03-15 04:42 出处:网络
I have an Activity, A, instantiated 3 times for example (A1, A2, A3) in different parts of the back stack.

I have an Activity, A, instantiated 3 times for example (A1, A2, A3) in different parts of the back stack.

If my stack contains the following example: A1 -> B -> C -> A2 -> D -> A3 -> E, how can i specificall开发者_C百科y retrieve A1 or A2?

I am aware of FLAG_ACTIVITY_CLEAR_TOP but this only works well when there's only 1 instance of your Activity in your back stack. In my case it has only retrieved A3 when I've set this flag.

I am using the 2.3 SDK.

Thanks for any help!


Easiest: keep them separately in a Set (adding it in onCreate()/removing in onDestroy()). Really. You can keep reference to the set in Application .... Really.

0

精彩评论

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