I have two activities in an android application, each has a button that goes to the other activity (by startActivity() method). In the second activity, I have an edit text (URL address bar) and a web view.
So, when I click on the button of activity1 to start activity2, I get activity2 with the web view. Then I type cnn.com (for example) in the address bar and my web view displays the cnn.com web site. After that, I click on the button to go from activity2 to activity1.
If I click again on the button of activity1, I start activity2. But activity2 has just been created, I mean, the edit text and the web view are empty.
What I want is: if I return from activity1 to activity2, I want activity2 to keep the last state: the edit text should keep cnn.com and the web view should keep displaying the CNN web site.
So what I need is not to quit activity2 before starting activity1, but something like just hiding it and starting activity2, so that if I return to it again, I get its last state. (Like when I click on the home button.) How can I achieve this?