I need to read and write files of a specific route in my SDcard, when I work with Android versions that do not require permission, I do not have problems, but when I work with versions that require permissions I am writing the following:
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
// mis rutinas
}else{
ActivityCompat.requestPermissions(PrincipalActivity.this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},0);
return;
}
}else{
// mis rutinas;
}
I want to know if it is possible to obtain the result after accepting or not the requested permission with ActivityCompat.requestPermissions , in order to launch a routine that requires this result.
Thank you.