title: I am using Android studio I want to write local text file via emulator
body: <p>I want to write text file in local pc via emulator and i have try a lot of way but not yet successes so i need help for any one who will recognized what my problem. below is my codes.
  This code work without an error but working less.</p>
  
  <pre><code>public void WriteText() {
      EditText txt=(EditText)findViewById(R.id.txtwrite);
  
  
      try {
          FileOutputStream fos = openFileOutput("D:/File.txt", Context.MODE_PRIVATE);
          fos.write(txt.getText().toString().getBytes());
          fos.close();
          Toast.makeText(this, "Saved", Toast.LENGTH_LONG);
      } catch (Exception e) {
          Toast.makeText(this,e.getMessage(),Toast.LENGTH_LONG);
      }
  }
  </code></pre>