Created
February 3, 2019 09:00
-
-
Save imammubin/850797bdacd27bd2e88b22abdd7c4dd4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(ContextCompat.checkSelfPermission (this,Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) | |
{ | |
ActivityCompat.requestPermissions(this,new String[] | |
{ | |
Manifest.permission.WRITE_EXTERNAL_STORAGE, | |
Manifest.permission.READ_EXTERNAL_STORAGE, | |
},1); | |
} | |
File folder = new File(Environment.getExternalStorageDirectory() + File.separator + "AAMubin"); | |
if (!folder.exists()) { | |
folder.mkdirs(); | |
} | |
/* DONT FORGET WRITE PERMISSION on AndroidManifest */ | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment