Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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