I have implemented a test sample of android drawer using activities instead of frames like in this SO answer.
I have 3 Activities that extends from DrawerActivity.
MainActivity
that is the first activity when application is launched, ActivityA
and ActivityB
which are opened from navigation drawer.
I want that when back button is pressed in MainActivity to exit application, and when pressed on ActivityA or ActivityB to go back to MainActivity, no matter how many times are pressed list items from navigation drawer.
As far as I can understand, the problem is that all activities that are started from navigation drawer are added at back stack.
Also an extra question is how to highlight the item selected on navigation drawer when activities are changed?
I have done it in another sample that uses fragments with this code:
mDrawerList.setItemChecked(position, true);
Can I use Activities or do I need to convert them to Fragments?