Reputation: 2834
Simple question: How can I clear Activity
stack keeping current one?
I have a LoginActivity, HomeActivity and 100 more activities. I come to HomeActivity from 101 activities. I can clear activity stack
startActivity()
from those 101 activities using intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
I want to do the 2nd. Is it possible? If yes, how? I want to clear activity stack to free resources.
Upvotes: 1
Views: 828
Reputation: 316
Add android:clearTaskOnLaunch="true"
and
android:launchMode="singleTask"
in your HomeActivity manifest tag.
Upvotes: 3