Search
 
SCRIPT & CODE EXAMPLE
 

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();
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java replace character in string 
Java :: how to convert string array to int in java 
Java :: how to initialize a set in java 
Java :: java thread dump 
Java :: get timezone offset java 
Java :: decode base64 to file java 
Java :: java random between two strings 
Java :: from string to double java 
Java :: android add activity parent manifest 
Java :: check if string is uuid 
Java :: reentrantlock java 
Java :: while loop java 
Java :: max int in java 
Java :: java copy file 
Java :: java button size 
Java :: double.parsedouble in java 
Java :: java Write a program to reverse an array or string 
Java :: sum of list java 
Java :: numbers of digits java 
Java :: java count to 10 
Java :: has a relationship in java 
Java :: javafx main class 
Java :: how to return array in java 
Java :: java try and catch 
Java :: java system.out.println 
Java :: send action bar message bukkit 
Java :: int [] to Integer[] 
Java :: arraylist replace value java 
Java :: Program type already present: android.support.v4.app.INotificationSideChannel 
Java :: how to go to next iteration of while loop java 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =