title: Android 4.4+ : check if path is on secondary storage
body: <p>My app has to check if a certain folder is on the secondary storage when the Android version is 4.4+.</p>
  
  <p>I am using this:</p>
  
  <pre><code>private boolean isPathOnSecondaryStorage(String path) {
      boolean res=false;
      String secondaryStorage=System.getenv("SECONDARY_STORAGE");
      String[] secondaryPaths=secondaryStorage.split(":");
      for (int i=0;i&lt;secondaryPaths.length;i++) {
          String secondaryPath=secondaryPaths[i].trim();
          if (path.contains(secondaryPath)) {
              res=true;
          }
      }
      return res;
  }
  </code></pre>
  
  <p>Note that: </p>
  
  <ul>
  <li><p>path is chosen by the user by means of a file chooser activity, starting from /mnt</p></li>
  <li><p>the app wants to check what is mounted as usual, like when an external SD-card is inserted in its slot</p></li>
  </ul>
  
  <p>So I ask whether the above mentioned code will be always able to detect when the path is on a secondary storage, or instead on some devices it could find strange mounting points different from /mnt (Android 4.4+).</p>