Revision 8460c173
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/examples/save/SaveActivity.java | ||
---|---|---|
46 | 46 |
// Checks if the app has permission to write to device storage |
47 | 47 |
// If the app does not has permission then the user will be prompted to grant permissions |
48 | 48 |
|
49 |
private void verifyStoragePermissions()
|
|
50 |
{
|
|
51 |
int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
|
49 |
private void verifyStoragePermissions() |
|
50 |
{ |
|
51 |
int permission = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE); |
|
52 | 52 |
|
53 |
if (permission != PackageManager.PERMISSION_GRANTED)
|
|
54 |
{
|
|
55 |
ActivityCompat.requestPermissions( this, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE );
|
|
56 |
}
|
|
57 |
}
|
|
53 |
if (permission != PackageManager.PERMISSION_GRANTED) |
|
54 |
{ |
|
55 |
ActivityCompat.requestPermissions( this, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE ); |
|
56 |
} |
|
57 |
} |
|
58 | 58 |
|
59 | 59 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
60 | 60 |
|
Also available in: Unified diff
Javadoc