Trying to add a fragment to my fragment container FrameLayout

我怕爱的太早我们不能终老 提交于 2019-11-29 09:05:35

You forgot to commit() your transaction.

seken1

You also forgot to call the addtoBackStack() method, otherwise your app closes when you hit the back button.

add commit() like this

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