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: Android ShouldPersistState fires twice #1887

merged 1 commit into from Jan 5, 2019


None yet
2 participants
Copy link

cabauman commented Jan 5, 2019

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
closes #1865, closes #991

What is the current behavior? (You can also link to an open issue here)
ShouldPersistState fires twice upon sending the app to the background.

What is the new behavior (if this is a feature change)?
Won't fire multiple times.

What might this PR break?

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:
Android documentation strongly recommends saving persistent data in OnPause rather than OnSaveInstanceState. OnPause is invoked every time OnSaveInstanceState is (hence the duplicate ShouldPersistState emission), but not the other way around. Plus, OnSaveInstanceState is meant for saving transient UI state, e.g. saving a search query that the user entered in a text box.

@cabauman cabauman requested a review from reactiveui/android-team as a code owner Jan 5, 2019


This comment has been minimized.

Copy link

codecov bot commented Jan 5, 2019

Codecov Report

Merging #1887 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1887   +/-   ##
  Coverage    66.4%   66.4%           
  Files         110     110           
  Lines        4387    4387           
  Branches      579     579           
  Hits         2913    2913           
  Misses       1305    1305           
  Partials      169     169

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0a4faf...16c0a07. Read the comment docs.

@glennawatson glennawatson merged commit 691a8e3 into reactiveui:master Jan 5, 2019

4 checks passed

ReactiveUI Tests #9.7.6+8d99fe95cb succeeded
codecov/patch Coverage not affected when comparing c0a4faf...16c0a07
codecov/project 66.4% remains the same compared to c0a4faf
license/cla All CLA requirements met.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment