title: The method putString(String, String) in the type SharedPreferences.Editor is not applicable for the arguments (String, InputStream)
body: <p>I'm attempting to figure out a way to save the data from my InputStream and use it in another activity. So far I've tried to use sharedPreferences in the manner below - but I'm getting an error stating:</p>
  
  <pre><code>"The method putString(String, String) in the type SharedPreferences.Editor is not applicable for the arguments (String, InputStream)"
  </code></pre>
  
  <p>on the line:</p>
  
  <pre><code>editor.putString("fileName", attachment);
  </code></pre>
  
  <p>How might this be avoided?</p>
  
  <h2>Source:</h2>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      // get the attachment's filename
      Intent theIntent = getIntent();
      String attachmentFileName = "No file name found";
      if (theIntent != null &amp;&amp; theIntent.getData() != null) {
          Cursor c = getContentResolver().query(theIntent.getData(), null,
                  null, null, null);
          c.moveToFirst();
          final int fileNameColumnId = c
                  .getColumnIndex(MediaStore.MediaColumns.DISPLAY_NAME);
          if (fileNameColumnId &gt;= 0)
              attachmentFileName = c.getString(fileNameColumnId);
  
          try {
  
              InputStream attachment = getContentResolver().openInputStream(
                      getIntent().getData());
              SharedPreferences preferences = PreferenceManager
                      .getDefaultSharedPreferences(this);
              SharedPreferences.Editor editor = preferences.edit();
              editor.putString("fileName", attachment);
              editor.commit();
          } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
      }
  </code></pre>