When are ALL the cases when the onSaveInstanceState() method called?

后端 未结 7 835
粉色の甜心
粉色の甜心 2020-12-17 17:15

All the sources I read have all mentioned couple of cases and concluded with \"a few other cases\". What are ALL the cases when the onSaveInstanceState method called in a Vi

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 17:56

    onSaveInstanceState() will be called by default for a view if it has an id.

    google said: "The default implementation takes care of most of the UI per-instance state for you by calling onSaveInstanceState() on each view in the hierarchy that has an id".

    More info here.

提交回复
热议问题