- 
  Notifications
 You must be signed in to change notification settings 
- Fork 1.5k
Add a judgment condition(>API 26) when calling "FragmentManager.isSta... #262
Add a judgment condition(>API 26) when calling "FragmentManager.isSta... #262
Conversation
...teSaved" method.
 
 
 
 googlebot
 
 
 
 commented
 Oct 30, 2018 
 
 
 
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).
📝 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.
What to do if you already signed the CLA
Individual signers
- It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
Corporate signers
- Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to go/cla#troubleshoot (Public version).
- The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
- The email used to register you as an authorized contributor must also be attached to your GitHub account.
I signed it!
 
 
 
 googlebot
 
 
 
 commented
 Oct 30, 2018 
 
 
 
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.