Android: save file to SD-card
<p>.txt file need save in SD-card.</p>

<pre><code>Save("n" + String.valueOf(key) + ".txt");

 private void Save(String FileName){
         File fileName = null;
         String sdState = android.os.Environment.getExternalStorageState();

         if (sdState.equals(android.os.Environment.MEDIA_MOUNTED)) {
             File sdDir = android.os.Environment.getExternalStorageDirectory();
             fileName = new File(sdDir, "FlyNote/"+FileName);
             } else {
                 fileName = context.getCacheDir();
             }
         if (!fileName.exists())
             fileName.mkdirs();
         try {
             FileWriter f = new FileWriter(fileName);
             f.write(editText2.getText().toString());
             f.flush();
             f.close();
         } catch (Exception e) {

         }
     }
</code></pre>

<p>But in the SD-card file saves as a folder.
Folder "n5.txt" and other...</p>
