How to create a folder in Download directory (Android Studio)
问题 I'd like to create a directory in a Download directory (the one which stores all the files I download from web) so I can see it in browser after I plug the mobile into my PC. File myDirectory = new File(dir, "NewDirectory"); What should be the value of dir? 回答1: File dir = new File(Environment.getExternalStorageDirectory() + "/Download/your folder/"); dir.mkdirs(); // creates needed dirs Don't forget to ask for permissions on Marshmallow or newer and to add the write storage permission to