nowinandroid icon indicating copy to clipboard operation
nowinandroid copied to clipboard

[Bug]: Screen is not retained after process death

Open gyorgygabor opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is there a StackOverflow question about this issue?

  • [X] I have searched StackOverflow

What happened?

Steps to reproduce:

  1. Open the app
  2. Go to Interests -> Accessibility(just an example)
  3. Put the app in the background
  4. Trigger a process death
  5. Reopen the app

Result: The For You screen is opened, instead of the last opened screen(Interests -> Accessibility)

Tested on Samsung S20, demoDebug build.

Relevant logcat output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

gyorgygabor avatar Oct 03 '24 07:10 gyorgygabor

Seems that this is not a bug, rather a normal behaviour of the app.

Vivek-2004 avatar Oct 15 '24 19:10 Vivek-2004

Saved instance state bundles persist through both configuration changes and process death, use saved instance state to store a minimal amount of data necessary, such as an ID, to re-create the data necessary to restore the UI back to its previous state should the other persistence mechanisms fail. Most apps should implement this to handle system-initiated process death.

https://developer.android.com/topic/libraries/architecture/saving-states#onsaveinstancestate

vvb2060 avatar Nov 26 '24 18:11 vvb2060

I can't reproduce this with the latest main code. Please re-open if you can still reproduce.

alexvanyo avatar Dec 13 '24 23:12 alexvanyo

@alexvanyo open the app scroll the list switch to other app exec adb shell am kill com.google.samples.apps.nowinandroid to simulate the system-initiated process death come back to this app the scroll position of list is lost

vvb2060 avatar Dec 21 '24 06:12 vvb2060

Interesting, only the scroll position of for you tab is not saved, the scroll position of other lists is stored normally. I think this is a bug.

vvb2060 avatar Dec 21 '24 06:12 vvb2060