save documents on android 11 site 3astackoverflow com

Solutions on MaxInterview for save documents on android 11 site 3astackoverflow com by the best coders in the world

showing results for - "save documents on android 11 site 3astackoverflow com"
Marceau
10 Aug 2018
1 public  static  File commonDocumentDirPath(String FolderName){
2        File dir = null ;
3
4        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
5            dir = new File (Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)+ "/"+FolderName );
6        } else {
7            dir = new File(Environment.getExternalStorageDirectory() + "/"+FolderName);
8        }
9
10    // Make sure the path directory exists.
11   if (!dir.exists()) {
12          // Make it, if it doesn't exit
13         boolean success=dir.mkdirs();
14         if(!success) {dir=null;}
15
16
17   }
18            
19        return  dir ;
20
21    }
22
similar questions