Estoy implementando una clase externa en mi proyecto de android para manejar los permisos:
class RequesterPermissions extends ActivityCompat {
private final static String TAG = "RequesterPermissions";
private Activity activity;
RequesterPermissions(Activity activity){
this.activity = activity;
}
boolean checkIfPermissionIsGranted(String permission){
boolean Return = false;
int permissionChecked = ContextCompat.checkSelfPermission(this.activity, permission);
if(permissionChecked == PackageManager.PERMISSION_GRANTED){
// Permission already granted
Return = true;
}else if(permissionChecked == PackageManager.PERMISSION_DENIED){
// Permission denied
Return = false;
}
return Return;
}
void requestForPermission(String[] permission){
// Open dialog to grant or denied permission
ActivityCompat.requestPermissions(this.activity, permission, 1);
}
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case 1: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// Permission granted
Log.d(TAG, permissions[0] + " granted");
} else {
// Permission denied
Log.e(TAG, permissions[0] + " denied");
}
}
}
}
}
Mi problema es que me tira este error en el método onRequestPermissionsResult()
:
Error:(41, 5) error: method does not override or implement a method from a supertype
¿Cómo puedo solucionar esto?