且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

方向改变后没有碎片重新添加

更新时间:2023-12-03 13:16:04

原来我干了件蠢事。我推翻我的活动的onSaveInstanceState(...)方法,而不调用 super.onSaveInstanceState(),这导致在片段不被重建。在这里张贴的答案,希望我能拯救其他人的时候了!

Turns out I did a Stupid Thing. I overrode the onSaveInstanceState(...) method in my activity, without calling super.onSaveInstanceState(), which resulted in the fragments not being recreated. Posting the answer here in hopes that I can save somebody else the time!