request permissions in api > 23 (Android N etc.)

I'm not sure but did you mean ">=" ?
This commit is contained in:
Serge 2017-08-08 11:47:10 +03:00 committed by GitHub
parent c83659ffa9
commit 421a7c7de9
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ public class StorageErrorActivity extends AppCompatActivity {
openDirectoryChooser(); openDirectoryChooser();
} }
}); });
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
int readPermission = ActivityCompat.checkSelfPermission(this, int readPermission = ActivityCompat.checkSelfPermission(this,
Manifest.permission.READ_EXTERNAL_STORAGE); Manifest.permission.READ_EXTERNAL_STORAGE);
int writePermission = ActivityCompat.checkSelfPermission(this, int writePermission = ActivityCompat.checkSelfPermission(this,