commit | 1ba7c89dbf4e2c7e519380f9a80ea2336146506c | [log] [tgz] |
---|---|---|
author | Chihhang Chuang <chihhangchuang@google.com> | Tue Jun 22 00:14:52 2021 +0800 |
committer | Chihhang Chuang <chihhangchuang@google.com> | Tue Jun 22 11:08:55 2021 +0800 |
tree | 7b3a5d1f8d44ab8ca96cd9fa18688265a47878d3 | |
parent | 20911a95fff70d62de82acb970af6d1a3c9109fa [diff] |
Save state, and restore when back from back stack The view would be destroyed when a fragmanet is added to back stack, and calls #onCreateView when back to foreground, that's why the home page alway get scrolled to head. We need to use a variable to save the state and restore in #onCreateView, see https://developer.android.com/guide/fragments/saving-state Video: https://drive.google.com/file/d/1QA5_0Lw-bH_sokque_VY53Xhz8ITQnMr/view?usp=sharing Fixes: 191660580 Test: Manually Change-Id: I458168b69d394bc97308f249b3e2871212dee1be