Check For Permission and Request

ID - _BUGFISH - E#17
^Top
<< Back
Mobile-Menu










Check For Permission and Request
Category: Android-Java
Sub-Category:
Creator: Jan-Maurice Dahlmanns
Created: 2020-08-15 03:37:51
Modified: 2024-11-17 04:45:57
Views: 852

Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.

This is Example for Internet Permissions

Android Manifest XML (for every Permissoin u need one of this fitting block)

    <!-- Declare Use Of Internet -->
        <uses-permission android:name="android.permission.INTERNET"/>

Java Content:
if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.INTERNET)
!= PackageManager.PERMISSION_GRANTED) {

int MY_PERMISSIONS_REQUEST_INTERNET = 0;
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.INTERNET},
MY_PERMISSIONS_REQUEST_INTERNET);

}
 

May Replace "Manifest.permission.INTERNET" with that one needed.

 

Currently 0 Upvotes!

captcha image
System - 2024-11-05 18:28:27
Commenting System Initialized! Have a very nice day!

Switches: 0 | Arrivals: 6 | Visits: 6
This Website is using Session Cookies for Site Functionality.