i am facing a weird issue in android. I am saving a path in by calling Environment.getExternalStorageDirectory().getPath()+"/Folder/"
in onCreate()
method of my an activity and saving into a sqlite table as VARCHAR(Tried BLOB and TEXT as well). When i am accessing that path in a method it's force closing my app. App closes when i am using that File object for files.listfiles()
but when i am using string to create a File object it force closes, however if i use simple string like /mnt/sdcard/Folder/
, it works but i want to use stored path. I checked logcat showing both path same as
03-15 13:59:21.698 24977-24977/com.backuprestoremaster D/Path﹕ /storage/emulated/0/Backup Master/ And Enivronment directory is /storage/emulated/0/Backup Master/
Is there any difference between
// path is the string i got from cursor and logcat says path : /storage/emulated/0/Backup Master/
File f = new File (path);
but no error in this
File f = new File ("/storage/emulated/0/Backup Master/");
Where is the difference??
Aucun commentaire:
Enregistrer un commentaire