Issue
Is there a way to programmaticaly see if an activity already exists in the stack and re-use it instead of re-creating it?
The situation occurs that a user can enter an activity via multiple routes and go onward via multiple routes also. However that same activity can be reached again after a few more clicks through other activities. I want to avoid the app going the creation of a new activity when I know it already exists in the stack.
This might just be down to my bad design (this is my first app). But was just wondering how this can be managed? Is there a solution to this?
Solution
Well this kind of freeform activity access is a bit frowned on in the android UI guidelines, but you can use the FLAG_ACTIVITY_REORDER_TO_FRONT
in your Intent to reshuffle your activity to the front.
Alternately, you can also use FLAG_ACTIVITY_CLEAR_TOP
to clear the stack on top of your activity.
Answered By - JRaymond
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.