0

How do I create folder in INTERNAL STORAGE and save bitmap image in folder on Android marshmallow. I wanted to know particularly in Marshmallow... And I have given all the permission in manifest file. Please help me out to solve this problem..

1 Answers1

0

In particularly Marshmallow version, Permission are need to be taken Programatically. Following is the sample code to read external storage.

ActivityCompat.requestPermissions(MainActivity.this,
                new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
                PERMISSION_CODE);

In method onResultPermissionsRequest()

@Override
public void onRequestPermissionsResult(int requestCode,
                                   String permissions[], int[] grantResults) {
   if(requestCode == PERMISSION_CODE){
         if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){

                //Permission granted 
          }
          else{
               //Permission Not granted
          }

   }

}

Hope write similar code for various different permission. Hope this should work. In case this didn't work one thing is sure in Marshmallow need to take permissions dynamically.

Abhishek Borikar
  • 374
  • 1
  • 5
  • 15