Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Add a judgment condition(>API 26) when calling "FragmentManager.isSta... #262

Conversation

@CaiPeng
Copy link

@CaiPeng CaiPeng commented Oct 30, 2018

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

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

Copy link
Author

CaiPeng commented Oct 30, 2018

I signed it!

Copy link

CLAs look good, thanks!

Copy link
Contributor

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

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)

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.

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /