Preserving data over different Activities
<p>I'm having an issue with preserving the data entered by a user on my android activity classes. I have identified I need to make use of the <code>onSavedInstanceState(Bundle outState)</code> method but the way my program is written makes this difficult. </p>

<p>A user enters a variety of data in <code>DataEntry.java</code> class and the information they submit is displayed on <code>DataSummary.java</code>. This works fine. </p>

<p>But when a user navigates away from <code>DataSummary.java</code> say, to fill in the rest of the information on <code>DataEntry.java</code> the original submitted data is lost if you go back to <code>DS.java</code> to see what you've written already. Below is the code for <code>DataSummary.java</code>.</p>

<pre><code>public class DataSummary extends Activity {

ImageView resultImage;
TextView resultName; 
TextView resultDescription;
TextView resultType;
TextView resultProject;

public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState); 
   setContentView(R.layout.activity_data_summary);

   //Check if there is anything in the 'bundle' and if not produce message - AVOIDS NULLPOINTEREXCEPTION when navigating to Activity
   Bundle bundle = this.getIntent().getExtras();     
   if (bundle != null){
   int image = bundle.getInt("image");
   String name = bundle.getString("key");
   String description = bundle.getString("key1"); //gets data from DataEntry activity
   String type = bundle.getString("key2");
   String project = bundle.getString("key3");

   resultImage=(ImageView)findViewById(R.id.resultImage);
   resultName=(TextView)findViewById(R.id.resultName);  //adds the TextViews to the activity
   resultType=(TextView)findViewById(R.id.resultType);
   resultDescription=(TextView)findViewById(R.id.resultDesc);
   resultProject=(TextView)findViewById(R.id.resultProject);

   resultImage.setImageResource(image);
   resultName.setText(name); // Fills the textviews with imported data
   resultType.setText(type);
   resultDescription.setText(description);
   resultProject.setText(project);
   }    

   else
   {
       Toast.makeText(DataSummary.this,"Received no data yet!", Toast.LENGTH_LONG).show();
   }

}

/* MANAGES ACTIVITY LIFESTYLE */
public void onSavedInstanceState(Bundle outState){  
    super.onSaveInstanceState(outState);
}
</code></pre>

<p>How can I expand on the <code>onSavedInstanceState</code> method to get the imported data which is received when the Activity is created and preserved it if a user navigates away from this activity? Hope that's well explained enough?</p>

<p>It is difficult to figure out how to make use of the variables in onCreate as well as I cannot access them from another method (I think if I knew how to do this I could complete the method).</p>
