private class MainActivity.ButtonActions extends Object implements android.view.View.OnClickListener, androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
Modifier and Type | Field and Description |
---|---|
private android.app.Activity |
activity |
Constructor and Description |
---|
ButtonActions(android.app.Activity activity) |
Modifier and Type | Method and Description |
---|---|
private boolean |
isPermissionGranted()
Check if the reading of archives permission is granted.
|
void |
onClick(android.view.View v)
Implementation of the action depending on the button tapped on the app
(cancel button = go backwards, addFileButton = ask permision and continue
with the normal app flow, okButton = load all the information that will be
needed for the processes into the intent).
|
void |
onRequestPermissionsResult(int requestCode,
String[] permissions,
int[] grantResults)
We proceed with the normal flow of the app depending of which option was selected (reading
permission granted or denied).
|
public void onClick(android.view.View v)
onClick
in interface android.view.View.OnClickListener
v
- the view corresponding to the button tapped on screen by the user.private boolean isPermissionGranted()
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
onRequestPermissionsResult
in interface androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
requestCode
- related to the "Constants" configuration.permissions
- related to the reading permissions, which can never be null.grantResults
- related to the granted permission, which also cant be null.ActivityCompat.requestPermissions(android.app.Activity, String[], int)