Android view turn off implicit state retaining for some view

后端 未结 2 1863
生来不讨喜
生来不讨喜 2021-02-05 03:24

I have custom View which is dynamically added multiple times in same activity.

Each of custom view instance has beside other stuff a

2条回答
  •  旧时难觅i
    2021-02-05 04:02

    You can use View.setSaveEnabled (boolean enabled) method.

    It's also possible to disable automatic state saving via xml using saveEnabled attribute android:saveEnabled="false"

提交回复
热议问题