Skip to content

Commit

Permalink
Merge pull request #61 from phcannesson/fix/fragment-callback
Browse files Browse the repository at this point in the history
Fixed android.app.Fragment callbacks from rationale dialog
  • Loading branch information
samtstern committed Dec 6, 2016
2 parents f5ab8ce + 02e71e9 commit d1efe77
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ class RationaleDialogClickListener implements Dialog.OnClickListener {
RationaleDialogConfig config,
EasyPermissions.PermissionCallbacks callbacks) {

mHost = dialogFragment.getActivity();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
mHost = dialogFragment.getParentFragment() != null ?
dialogFragment.getParentFragment() :
dialogFragment.getActivity();
} else {
mHost = dialogFragment.getActivity();
}

mConfig = config;
mCallbacks = callbacks;
}
Expand Down

0 comments on commit d1efe77

Please sign in to comment.