getFragmentManager( ) and support package

我只是一个虾纸丫 提交于 2019-12-25 04:56:21

问题


I'm learning to use fragments for build a dynamic application, but I've a problem with the Fragment Manager. When I pass it by the method getFragmentManager( ) is shown a warning because it returns the Fragment Manager of android.app, not from the support library. Do you know how to fix it?


回答1:


You should use getSupportFragmentManager() instead of getFragmentManager()

Also, make sure you are extending FragmentActivity and not just Activity.



来源:https://stackoverflow.com/questions/15460028/getfragmentmanager-and-support-package

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