I have a problem with maintaining the activities.
I have activity A, and when starting Activity B from Notification, I should end Activity A, and start Activity B.
In other words, At a same time, in stack, Only Activity A or Activity B should be present. Its' very easy achieve when am starting Activity B from Activity A, by calling finish()
in Activity A. But cannot achieve the same when starting activity from notification.
Stack should be like this,
- MainActivity -- Activity A
- MainActivity -- Activity B (When starting activity B from notification)
But My Stack looks like,
- MainActivity -- Activity A -- Activity B
What Intent flags or launch mode should be used for this.