Overlapping Fragments when resuming Activity

ⅰ亾dé卋堺 提交于 2019-12-04 17:29:19

So the problem is that you have fragment A added in your onCreate. After navigating to fragment B your activity goes into the background. In certain cases as you know android can kill your background activity and force it to recreate itself when it comes to the foreground. Thus your activity recreates itself with fragment B which was its last state when it went into the background, as well as adds fragment A because onCreate was called. You can solve this by doing a savedinstancestate check in your onCreate.

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