title: Save a Activity in Android When moved to another Activity
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/151777/how-do-i-save-an-android-applications-state">How do I save an Android application&#39;s state?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm currently working an application that has the following behavior : 
  i am using 2 Edittext and there are some value which i type in it and when i press the button
  it will move on to the next page or activity ,But the problem is here when i return back to activity i dont find the values in edittext PLease help me ..
  Please let me know the code ...
  Thanks in Advance....</p>
  
  <p>This is my code....</p>
  
  <pre><code>public class TestsampleActivity extends Activity 
  {
          Button b1,b2;
          TextView t1;
          EditText e1;
  
          /** Called when the activity is first created. */
          @Override
          public void onCreate(Bundle savedInstanceState) 
          {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.main);
  
              b1= (Button)findViewById(R.id.btn1);
              b2= (Button)findViewById(R.id.btn2);
              t1=(TextView)findViewById(R.id.tv1);
              e1=(EditText)findViewById(R.id.et1);
  
  
              b1.setOnClickListener(new Button.OnClickListener() 
              {   
                   public void onClick (View v){ add(); }
              });
  
              b2.setOnClickListener(new Button.OnClickListener() 
              { 
                   public void onClick (View v){ del(); }
              });
         }
         public void add()
         {
              String s1= e1.getText().toString();
              Intent intent=new Intent(this,next.class);
              intent.putExtra("name",s1);
              startActivity(intent);
  
  
              /* String s1= e1.getText().toString();
              //t1.append(s1);
              t1.setText(s1);
              */
         }
         public void del()
         {             
             e1.setText("");
             t1.setText("");
         }
  }
  </code></pre>