is a view's “tag” restored when the activity whose layout contains the view is recreated?

限于喜欢 提交于 2019-12-04 02:17:07

if I set a tag on a View (that has a unique id) in my activity's layout and then the activity is destroyed by the system and subsequently re-created, will that view, when recreated, automatically be tagged with the Object I originally set?

No, based on my reading of the source code.

The system expects to recreate the activity at some later date, so I could see it keeping around a reference to the original tag.

That is not always possible, as the saved instance state Bundle needs to be transportable across process boundaries.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!