# App permission
# 1. Dynamic permission application
All permissions which require dynamic application can be applied for on demand.
If the user agrees to the permission application, he/she can continue to use the App; otherwise, the system will forcibly exit the user from the App.
The dynamic permission batch application code is as follows:
private String[] permissions = new String[] {
Manifest.permission.ACCESS_NETWORK_STATE,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
};
ActivityCompat.requestPermissions(this,permissions,PERMISSIONCODE);
- The dynamic permission interface is as follows:
# 2. Unnecessary to use dynamic permission
Set
targetSdkVersion
to less than or equal to 22