title: Trouble using sharedPreferences between two activities
body: <p>I am trying to save a date in one activity and then have that date put in a textView in another activity.  I am not sure about how to get the two activities to communicate with each other.
  In file called report.java I have this method that gets the date and save it in sharedPrefernces.</p>
  
  <pre><code>private void updateLabel() {
      date.setText(fmtDate.format(dateAndTime.getTime()));
      SharedPreferences preferences = getPreferences(MODE_PRIVATE);
      SharedPreferences.Editor editor = preferences.edit();
      editor.putString("date", date.getText().toString()); // value to store
      editor.commit();
  }
  </code></pre>
  
  <p>I am trying to figure out how to get my file called inspection use this to populate a textView
  The problem I think I am having is with getting the correct name for the report file.</p>
  
  <pre><code>public static final String PREF_FILE_NAME = "report";
     SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE);
  </code></pre>
  
  <p>then I have this code on a method called onResume()</p>
  
  <pre><code>    @Override
  public void onResume() {
      super.onResume();
      SharedPreferences preferences = getPreferences(MODE_PRIVATE);
      String strDate=preferences.getString("date", date.getText().toString());
  
      date.setText(strDate);
  
  }
  </code></pre>