0

i try to get internal memory file or path.but i cant do it.below codes not worked for me.

ContextWrapper cw = new ContextWrapper(getApplicationContext());
File directory = new File(cw.getFilesDir(), "Music");
directory.mkdirs();
File file = new File(directory, "aaa.mp3");
file.createNewFile();
file.mkdirs();

OR

File dir=Environment.getDownloadCacheDirectory();
dir.createNewFile();
dir.mkdirs();
File file = new File(dir, "aaa.mp3");
file.createNewFile();
file.mkdirs();

OR

File dir=Environment.getDataDirectory();
dir.createNewFile();
dir.mkdirs();
File file = new File(dir, "aaa.mp3");
file.createNewFile();
file.mkdirs();

plz explain about getDirFiles().i read in same cases getDirFiles() worked.but i cant use it.

1 Answers1

0

Its a little late. If you have not find out the solution then just check my same issue conversation as yours .

Sometimes we write the perfect logic but still we face problem for some reasons.Like physical connection between device and compter which makes obstacle to fetch data from device.

Community
  • 1
  • 1
Ranjit
  • 5,130
  • 3
  • 30
  • 66