Issue
I have 3 activities in my application
- ActA
- ActB
- ActC
Suppose I am in activity ActB
and I am loading ActC
with out finish();
ActB
Then when press a button in ActC
, need to redirect the application to ActB
. But this time when I press back from redirected ActB
, another ActB
( previously loaded ) is showing.
Is there any way to kill all the activities which are previously loaded when we press the button in ActC
?
I am new to android and its ruining my time
Please help thanks in advance
Solution
Suppose you move like this A -> B -> C All the previous instances will be there in backstack for previous activities. until and unless it is your requirement to create new instance of activity then only do so. when you press button in you want to come to B but if you don't need new instance of B you can go with backstack item and according to me you should.
in button click you can simply call onBackPressed() of activity which is called when you press back button of device.
Also as Vee said you can use that flag to clear activities above your current activity.
Answered By - Siddhesh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.