title: How to restore when activity is destroyed or paused?
body: <p>Okay so im having a hard time saving the state of my activity so that when the activity is destroyed it can restore where the user last left off. Here is my source code. If anyone could look at it and tell me how i would save and restore is please it will be greatly appreciated. </p>
  
  <p>Here is my code...</p>
  
  <pre><code>                public class DorothyTalk extends Activity{
      Handler handler = new Handler();
      int typeBar;
  TextView text1;
  EditText edit;
  Button respond;
  private String name;
  private ProgressDialog progDialog;
  @Override 
  public void onCreate(Bundle savedInstanceState){
      super.onCreate(savedInstanceState);
      setContentView(R.layout.dorothydialog);
  
      text1 = (TextView)findViewById(com.fttech.da.R.id.dialog);
      edit = (EditText)findViewById(com.fttech.da.R.id.repsond);
      respond = (Button)findViewById(com.fttech.da.R.id.button01);
  
      Talk();
  
  }
  
      protected Dialog onCreateDialog(int id) {
  switch(id) {
  case 0:                      // Spinner
      progDialog = new ProgressDialog(this);
      progDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
      progDialog.setMessage("Loading...");
      progDialog.setProgress(100);
  
      return progDialog;
  </code></pre>
  
  <p>}
      return progDialog;
  }
          public void  Talk(){</p>
  
  <pre><code>    text1.setText("Welcome what is your name?");
  
      respond.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              name = edit.getText().toString();
              new AsyncTask&lt;Void, Integer, Void&gt;(){
  
              @Override
          protected Void doInBackground(Void... arg0) {
              try {                 
               Thread.sleep(1000);             
              } catch (InterruptedException e) {                         
                  e.printStackTrace();             
                      }            
                      return null;
              }
              @Override         
          protected void onPostExecute(Void result) {             
                      text1.setText("Nice to meet you "+name);
                      dismissDialog(typeBar);
                       }
  
  
                  @Override        
          protected void onPreExecute() { 
              typeBar = 0;
          showDialog(typeBar);
  
          }
  
          }.execute((Void)null);
  
          }
      });
      }
  
  
      public void onBackPressed()
        {
          int i = Log.d("CDA", "onBackPressed Called");
          Context localContext = getApplicationContext();
          Intent localIntent = new Intent(localContext, mainMenu.class);
          startActivityForResult(localIntent, 0);
  
          return;
  
  
  
  
      }
  </code></pre>
  
  <p>How can i save and restore when activity is destroyed?</p>