Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PreferencesActivity crash on API < 17 #1325

Merged
merged 3 commits into from
May 6, 2019

Conversation

mueller-ma
Copy link
Member

Signed-off-by: mueller-ma mueller-ma@users.noreply.github.com

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
@mueller-ma mueller-ma added the bug Indicates an unexpected problem or unintended behavior label Apr 25, 2019
Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
@maniac103
Copy link
Contributor

I wonder whether simply calling just isFinishing() wouldn't be sufficient here?

@mueller-ma
Copy link
Member Author

Good question. Since I cannot reproduce this crash, I've looked up on the Internet and found this fix.

@maniac103
Copy link
Contributor

Probably could/should check FragmentManager.isStateSaved() instead, and move the check into the respective case statement.

@mueller-ma
Copy link
Member Author

FragmentManager.isStateSaved() isn't available on all API levels we support. This would require us changing the whole PreferenceActivity to use the AppCompat version of PreferenceFragment.

@maniac103
Copy link
Contributor

Wouldn't that be a good either either way anyway? ;-)

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
@mueller-ma
Copy link
Member Author

Definitely, but that's a larger task and I want to focus on the pending PRs and #257 for now. It's tracked in #1295.
I removed the isDestroyed() call.

@mueller-ma mueller-ma merged commit 8bf7cc0 into openhab:master May 6, 2019
@mueller-ma mueller-ma deleted the fix-pref-crash branch May 6, 2019 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants