且构网

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

片段onCreateView多次调用

更新时间:2023-12-02 23:01:40

解决了这个问题!

FragmentTransaction的实际问题是我正在使用

Actual problem was with FragmentTransaction for which I'm adding fragments using .add() which causes the view to be populated twice.

代替使用:

.replace(R.id.yourId, fragment)