I have a main menu activity with a bunch of buttons. One button starts a new activity that allows the user to fill out and submit a form. When the user submits the form, a third activity starts, basically just a screen with some content and a button to return to the main menu. However, when I create an intent and go to the main activity, setContentView() is not working and my button assignments cause a NullPointerException.
I know there is some way to go back in the stack, either via intent flags or calling finish(). I haven't had success with intent flags such as Intent.FLAG_ACTIVITY_CLEAR_TOP
. finish() will not work since I am two activities away, not one. What is the proper way of getting back to the main activity?
Thanks