title: Saving data in edittext when hitting Back button
body: <p>So on activity 1 I click a button that takes me to activity 2. In activity 2 I enter some data  into an EditText.  When I hit the back button on the phone it takes me to activity 1 which is correct but if I hit the activity 1 button again any text that I entered into the EditText is gone.  I am sure this is because I am starting a new Intent every time I hit my button and I think I need to be using Flags but I am not certain. Below is my basic MainActivity1 and MainActivity2 without the code I tried that didn't work.</p>
  
  <p>**Edit:  After exiting the app all saved data needs to be deleted.</p>
  
  <p>MainActivity1</p>
  
  <pre><code>public class MainActivity extends Activity {
  
  Button b1;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      b1 = (Button)findViewById(R.id.button2);
      b1.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View arg0) {
              // TODO Auto-generated method stub
  
              Intent i = new Intent(MainActivity.this,MainActivity2.class);
              startActivity(i);
  
  
          }
      });
  }
  
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.main, menu);
      return true;
  }
  </code></pre>
  
  <p>MainActivity2</p>
  
  <pre><code>public class MainActivity2 extends Activity {
  
  
  EditText et1;
  
  @Override
  protected void onCreate(Bundle outState) {
      super.onCreate(outState);
      setContentView(R.layout.activity_main_2);
  
      et1 = (EditText)findViewById(R.id.editText1);
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Thank you in advance.</p>