Closed CaiPeng closed 5 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here (e.g. I signed it!
) and we'll verify it.
I signed it!
CLAs look good, thanks!
@CaiPeng can you explain a bit why this addition is needed?
When the dialog is shown, I clicked the denied button, and then my App crashed.
The log shows:
java.lang.NoSuchMethodError: No virtual method isStateSaved()Z in class Landroid/support/v4/app/FragmentManager; or its super classes (declaration of 'android.support.v4.app.FragmentManager' appears in /data/app/.../split_lib_dependencies_apk.apk:classes2.dex) at pub.devrel.easypermissions.RationaleDialogFragmentCompat.showAllowingStateLoss(RationaleDialogFragmentCompat.java:48) at pub.devrel.easypermissions.helper.BaseSupportPermissionsHelper.showRequestPermissionRationale(BaseSupportPermissionsHelper.java:43)
The FragmentManager
in the class you're modifying here comes from the support library. The isStateSaved
method was added in support lib 26.0.1
:
https://developer.android.com/reference/android/support/v4/app/FragmentManager#isstatesaved
What are your app dependencies? Are you using a lower support library level? I don't think adding an SDK version check should matter here.
@CaiPeng I am going to close this since it been a few weeks without a response and I can't see the motivation for this PR, however if you have more information please let me know and I will re-open.
Thanks for the contribution!
Add a judgment condition(>API 26) when calling "FragmentManager.isStateSaved" method.