Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.44 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. File not found issue in Android
  2. FileReader fr = new FileReader("myfile.txt");
  3.        
  4. File ff = new File("myfile.txt");
  5.        
  6. String state = Environment.getExternalStorageState();
  7.  
  8. if (Environment.MEDIA_MOUNTED.equals(state)) {
  9.         File options = new File(getAppDirectory(), "portal.xml");
  10. }
  11.        
  12. private String getAppDirectory() {
  13.     return new String(Environment.getExternalStorageDirectory().toString()
  14.             + "/foldername/foldername/");
  15. }