Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
ViewModels need to be cleared on Fragments that are being really destroyed, where "really destroyed" means that they are being destroyed without their state being saved, indicating that there's no chance they are going to be restored at a later time.
Unfortunately, isStateSaved(), despite its name, does double duty as a check on whether it is safe to do Fragment Transactions and is always true after onStop(), meaning it can be true even if the state has really not been saved, oddly enough.
We'll just not use isStateSaved() here and rely on a separate indicator for the "really destroyed" case.
Unfortunately, isStateSaved(), despite its name, does double duty as a check on whether it is safe to do Fragment Transactions and is always true after onStop(), meaning it can be true even if the state has really not been saved, oddly enough.
We'll just not use isStateSaved() here and rely on a separate indicator for the "really destroyed" case.
my...@gmail.com <my...@gmail.com> #3
@ comment #2 Fixed in which version?
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #5
We have to update compile SDK to 28 to adapt this fix?!
jb...@google.com <jb...@google.com> #7
When will 27.1.1 be released? It is a critical bug seriously.
ap...@google.com <ap...@google.com> #8
This also seems to have caused a side effect / bug where a ViewModel instance is recreated when its Activity is in the background when device is rotated.
Description
This code snippet will no longer work with lint tools
27.1.0+
(which is what's used in AGP 4.1.0+).It looks like it should be changed to
buildVariant
, and then there are changed APIs for accessing library info (the.libraries
call at the end will also need fixing).This results in the following failure when I build with newer lint tools and AGP 4.1.0-beta05 in our project