I've been testing the intent flags but I need to clarify something. I have two items in my navigation drawer and on click I do this,
Intent intent = new Intent(this, activityClazz);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
which classes are activities with same navigation drawers. -No fragment is used for various reasons-. In those activities I have buttons which open same activities but without the intent flags. What I wanted to do is to navigate activities with default Android behavior but also stack them in different stacks according to navigation items, like a tab usage.
Test case:
- startActivity without the clear-new flag
- startActivity with the clear-new flag
- back
I expect to return to the first activity since I started the second one with a new task, so the first one should have stayed in the first stack) but I found out that the first one already destroyed.