public class RequestPermissionsBaseActivity
extends AppCompatActivity
requestPermissions()
which will request all the permissions from the system.
Call declineRequestPermissions()
on the event the user chooses to decline giving permissions
to the app.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PARAM_PERMISSION_ARR_LIST
Parameter to pass in to this Activity to check if it exists or not.
|
static java.lang.String |
RESULT_PERMISSION_DENIED_LIST
If started with
Activity.onActivityResult(int, int, Intent) ,
result parameter included in the result intent that will include the granted permissions. |
static java.lang.String |
RESULT_PERMISSION_GRANTED_LIST
If started with
Activity.onActivityResult(int, int, Intent) ,
result parameter included in the result intent that will include the granted permissions. |
Constructor and Description |
---|
RequestPermissionsBaseActivity() |
Modifier and Type | Method and Description |
---|---|
protected void |
declineRequestPermissions()
The activity will return with the appropriate data in the result intent.
|
protected java.util.Collection<Permission> |
getDeniedPermissions()
Get the permissions that are currently denied by the system.
|
protected void |
onCreate(android.os.Bundle savedInstanceState) |
void |
onRequestPermissionsResult(int requestCode,
java.lang.String[] permission,
int[] status) |
protected void |
onSaveInstanceState(android.os.Bundle out) |
protected void |
onShowRationale(java.util.Collection<Permission> permissions)
Inheriting activities can call this to show their rationale for the given permissions.
|
protected void |
requestPermissions()
Request the permissions to the system.
|
public static final java.lang.String PARAM_PERMISSION_ARR_LIST
Activity.startActivityForResult(android.content.Intent, int)
.
This is expected to be an ArrayList of Permission
objects.public static final java.lang.String RESULT_PERMISSION_GRANTED_LIST
Activity.onActivityResult(int, int, Intent)
,
result parameter included in the result intent that will include the granted permissions.
This will be an ArrayList of Permission
objects.public static final java.lang.String RESULT_PERMISSION_DENIED_LIST
Activity.onActivityResult(int, int, Intent)
,
result parameter included in the result intent that will include the granted permissions.
This is expected to be an ArrayList of Permission
objects.protected void onCreate(android.os.Bundle savedInstanceState)
public void onRequestPermissionsResult(int requestCode, java.lang.String[] permission, int[] status)
protected void onSaveInstanceState(android.os.Bundle out)
protected void requestPermissions()
protected void declineRequestPermissions()
protected java.util.Collection<Permission> getDeniedPermissions()
protected void onShowRationale(java.util.Collection<Permission> permissions)
permissions
- Permissions that have not been granted yet and the reason for them to exist should
be explained to the user.