Where is the bundle of onSaveInstanceState saved?

后端 未结 5 1954
旧巷少年郎
旧巷少年郎 2020-12-15 18:21

I would like to know where the bundle \"outState\" of the method onSaveInstanceState(Bundle outState) is stored.

Is it stored in memory or in the device storage?

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-15 19:02

    The documentation as been updated and indicates precisely that the state is serialized to disk:

    Saved instance state bundles persist both configuration changes and process death, but are limited by amount of storage and speed because onSavedInstanceState() serializes data to disk.

    You can also found a table comparing the differents approches to preserving UI state

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

提交回复
热议问题