title: How do I change FileOutputStream directory when saving a file in Android?
body: <p>Here's my code:</p>
  <pre class="lang-java prettyprint-override"><code>String content = mEditText.getText().toString();
      
  FileOutputStream fos;
  try {
      fos = openFileOutput(title, MODE_PRIVATE);
      fos.write(content.getBytes());
      Toast.makeText(EditActivity.this, &quot;Saved to &quot;+getFilesDir() + &quot;/&quot; + title, Toast.LENGTH_LONG).show();
      fos.close();
      saved = true;
  } catch (IOException e) {
      Toast.makeText(EditActivity.this, &quot;Error happened&quot;, Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  <p>If I run the code like this, it tells saved to <code>/data/data/mypackagename/files/FileTitle</code>. I want it to save the file in another directory for example save to <code>/data/data/mypackagename/files/userData/FileTitle</code>.<br><br>I don't know any way to do this</p>