Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

check self permission android write_external_storage

private void checkDiskPermission ()
{
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
        Toast.makeText(this, "No Permissions" , Toast.LENGTH_LONG).show();
        ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 0);
    }
    else
    {
        Toast.makeText(this, "Has Permissions" , Toast.LENGTH_LONG).show();
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #permission #android
ADD COMMENT
Topic
Name
8+5 =