title: Android not saving to SD card
body: <p>I want to save a text file to the SD card I inserted into my HTC One M8 running lollipop. However when I run this code it saves to internal storage instead.</p>
  
  <pre><code>String FILENAME = "mysavefile.txt";
  
      File file = new File(Environment.getExternalStorageDirectory(), FILENAME);
  
      if (isExternalStorageWritable()) {
          errorSD.setVisibility(View.INVISIBLE);
          try {
              FileOutputStream fos = new FileOutputStream(file, false);
              fos.write(allInformation.getBytes(), 0, 81);
              fos.close();
              successfulSubmissionToast();
          } catch (FileNotFoundException e) {
              e.printStackTrace();
              errorSD.setVisibility(View.VISIBLE);
          } catch (IOException e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>It should be saving to</p>
  
  <pre><code>/storage/ext_sd
  </code></pre>
  
  <p>but instead it is saving to</p>
  
  <pre><code>/storage/emulated/0
  </code></pre>
  
  <p>Then I tried manually entering in the location of my SD card to see if that would work but it ended up throwing the FileNotFoundException</p>
  
  <pre><code>File file = new File("/storage/ext_sd", FILENAME);
  </code></pre>
  
  <p>Edit:
  I believe the issue is that there are multiple external storages. One being permanent and one temporary. The question is how do you access the second one.</p>