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
[master] Filtering state is lost across process death #663
Comments
On SavedStateHandle: good point, will update that. On filtering in the data layer: obvious thing to do in a real app, but in blueprints we use filtering as business logic to showcase how to do operations off the main thread. Same in the usecases branch. Not ideal, but adding more complexity would make the sample harder to follow. Many thanks! |
Now with the ViewModel-SavedState module reaching 1.0.0, the filtering can be persisted using SavedStateHandle. Line 63 in 6f21231
|
Added in #700 without LiveData and converting enum to ints since apparently there's no support for enums. |
No support for enums? that's odd, enums should (or I would expect them to) fall back to If this is intended, then that is quite an unfortunate limitation. One could use the enum name or ordinals I guess but that is still inconvenient. |
They are, my bad. I was simulating process death incorrectly. |
Value of
_currentFiltering
is never persisted to Bundle. If one were to useSavedStateHandle
to solve, this, the solution would look like this:The Repository (or
getTaskUseCase
, whichever is used) should select the right DAO method to call for getting filtered results from Room DAOAnd the DAO should expose LiveData with the correct filters
The text was updated successfully, but these errors were encountered: