Home > Enterprise >  Want to create Folder in File Manager of App but couldn't
Want to create Folder in File Manager of App but couldn't

Time:10-28

Folder is creating Successfully but the location is something like storage/emualted/0

I'm using Enviroment.getExternalStorageDirectory methods

I want to create publicily available folder which i could save my app's data what should i do?

CodePudding user response:

你可以使用 Context#getFilesDir() 或者Context#getCacheDir()

CodePudding user response:

it was restricted from google. below android 7 only u can create a folder inside internal folder. after that u only can create folder inside downloads,music and alarm

File folder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
File file = new File(folder, "example.txt");
if (!file .exists()){
    file .mkdirs();
}else{

  }
  • Related