Reputation: 19
I want to start the main activity from Broadcastresiver twice but close the previous one?
pop.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK );
But it doesn't work?
Upvotes: 0
Views: 4901
Reputation: 528
First Read Android Developers for more information
and then for close or finish activity you need to use
this.finish();
or
this.finishaffinity();
hope it help.
Upvotes: 0
Reputation: 475
Try using
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
Upvotes: 1