I am new to android and i am stuck with this. I have a login activity, when i click on login it goes to main menu where i have a grid view, so when i select an item from grid view it goes to next activity say "B",and when i click on confirm button in activity "B" it shows me activity "c" which has home button. I am using android:theme="@android:style/Theme.Dialog" theme which is showing my activity as a dialog.
When Clicked on home button, it should bring me to the main menu i.e. the Gridview. So now when i press back button in main menu it shows me activity "c", but my problem is i have to go to Login Activity.
I have tried putting finish() in activity "B" but in activity "C" when i click back button i want to c activity "B" which currently showing me main menu i.e. the gridview. I have also tried setting intent flag Intent.FLAG_ACTIVITY_CLEAR_TOP in activity "c" but it shows a black screen for a second before showing main menu.