Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Conversation

@CaiPeng
Copy link

@CaiPeng CaiPeng commented Oct 30, 2018

Add a judgment condition(>API 26) when calling "FragmentManager.isStateSaved" method.

@googlebot
Copy link

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
Corporate signers

@CaiPeng
Copy link
Author

CaiPeng commented Oct 30, 2018

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@samtstern
Copy link
Contributor

@CaiPeng can you explain a bit why this addition is needed?

@CaiPeng
Copy link
Author

CaiPeng commented Oct 31, 2018

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)

@samtstern
Copy link
Contributor

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.

@samtstern
Copy link
Contributor

@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!

@samtstern samtstern closed this Nov 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants