So I have 2 activities lets say A and B. A navigates to B, I want the activity A to be killed or make it unusable/unseen when directed from B.
so it should be like when I press the back button on B activity it should not open activity A instead it should go to the app tray.
also activity A should comeback when I clear the application data
thanks.
You could do this in one of two ways. First is finishing ActivityA so that it can’t be resumed to later. When starting ActivityB from ActivityA, you’d do something like this:
Another way is to just finish ActivityA when it gets a result of any sort from ActivityB. This code would also be in ActivityA.
To start ActivityB:
To make sure ActivityA doesn’t resume:
REQUEST_ACTIVITYBis just an int of your choosing.