Fixed
Status Update
Comments
du...@google.com <du...@google.com>
ap...@google.com <ap...@google.com> #2
+1, this is a severe bug if I've ever seen one. If it is on par with the #74139250 (https://issuetracker.google.com/issues/74139250 ), this should be at least P1
ap...@google.com <ap...@google.com> #3
1) Thank you for reporting this issue.We were not able to reproduce the issue with the information provided here.
Logs after follow mentioned steps in comment #1
===============================================
V/TAG: ViewModelFirst Created
2) Can you please provide the below requested information to better understand the issue:
Android build
Which Android build are you using? (e.g. KVT49L)
Device used
Which device did you use to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Logs after follow mentioned steps in
===============================================
V/TAG: ViewModelFirst Created
2) Can you please provide the below requested information to better understand the issue:
Android build
Which Android build are you using? (e.g. KVT49L)
Device used
Which device did you use to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
ap...@google.com <ap...@google.com> #4
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #5
@3
I have this problem on all my devices. Here are some of them:
1. Samsung Galaxy S9 (SM-G960F)
Android: 8.0.0 build: R16NW.G960FXXU1BRE5
2. Pixel2
Android: 9 build: PPP3.180510.008
3. Galaxy A3 (SM-A320FL)
Android: 7.0 build: NRD90M.A320FLXXS2BRAA
The three attachments included are: The built apk, the source code and a video displaying the issue.
The video showcases the app running on Galaxy S9 (Phone 1) with the following order:
1. Set "Don't keep activities" to enabled.
2. Happy case when everything is correct and onCleared() is called.
3. Fault case when the home button is pushed and onCleared() __is not called__.
I have this problem on all my devices. Here are some of them:
1. Samsung Galaxy S9 (SM-G960F)
Android: 8.0.0 build: R16NW.G960FXXU1BRE5
2. Pixel2
Android: 9 build: PPP3.180510.008
3. Galaxy A3 (SM-A320FL)
Android: 7.0 build: NRD90M.A320FLXXS2BRAA
The three attachments included are: The built apk, the source code and a video displaying the issue.
The video showcases the app running on Galaxy S9 (Phone 1) with the following order:
1. Set "Don't keep activities" to enabled.
2. Happy case when everything is correct and onCleared() is called.
3. Fault case when the home button is pushed and onCleared() __is not called__.
ap...@google.com <ap...@google.com> #6
I was able to reproduce this with "Don't keep activities" on.
Fragments currently use the fact that the system called onSaveInstanceState() as a marker on whether the Activity could be recreated. "Don't keep activities" specifically breaks that assumption by saving the instance state, then immediately throwing it away.
In a typical system, the only time that saved instance state would be thrown away would be if your process is being destroyed, of which there is no callback (either to your app or to ViewModels). Therefore this bug is limited to only devices using "Don't keep activities".
Saved state is an imperfect signal here, so we'll switch to the correct signal - Activity.isChangingConfigurations().
Fragments currently use the fact that the system called onSaveInstanceState() as a marker on whether the Activity could be recreated. "Don't keep activities" specifically breaks that assumption by saving the instance state, then immediately throwing it away.
In a typical system, the only time that saved instance state would be thrown away would be if your process is being destroyed, of which there is no callback (either to your app or to ViewModels). Therefore this bug is limited to only devices using "Don't keep activities".
Saved state is an imperfect signal here, so we'll switch to the correct signal - Activity.isChangingConfigurations().
ap...@google.com <ap...@google.com> #7
@6 Please also try my sample. on my sample I didn't enable "don't keep activities".
ap...@google.com <ap...@google.com> #8
The issue with onCleared not being called on Fragment hosted ViewModels is fixed internally and will be available in future releases of fragments.
ap...@google.com <ap...@google.com> #9
@8 What release will that be? Will it be part of the support library?
ap...@google.com <ap...@google.com> #10
Every release of the 28.0.0 Fragments and 1.0.0 AndroidX Fragments released after June 29th contains this fix, including beta01 and rc01. If you're still having issues, please file a new bug with reproduction steps and a sample project.
Description
Add new artifacts for room-paging-rx2/3 and -guava.