Closed polesapart closed 5 years ago
Great job. But you missed a null check. I've merged, fixed and published it to a new version.
Nice catch!
Still i'm getting this error :
Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
It's non-activity class and my code is:
String[] permissions = {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION};
Permissions.check(MainApp.getmContext(), permissions, null/*rationale*/, null/*options*/, new PermissionHandler() {
@Override
public void onGranted() {
// do your task.
Toast.makeText(MainApp.getmContext(), "Granted", Toast.LENGTH_SHORT).show();
}
@Override
public void onDenied(Context context, ArrayList<String> deniedPermissions) {
Toast.makeText(MainApp.getmContext(), "Denied", Toast.LENGTH_SHORT).show();
}
});
The error is coming on Permissions.check line.
Please give me the solution ASAP...
I get this error too. Sorry, can only supply you with obfocusated class: com.nabinbhandari.android.permissions.b.a (Unknown source: 129)
@AliAzaz @soenkegissel To solve this problem, pass new Options().setCreateNewTask(true)
instead of 'null
' to the parameter 'options
'.
This is needed for non-activity contexts. This should close #11 if adequately documented.