getSupportFragmentManager() versus getFragmentManager() in android 3.0+

后端 未结 3 471
半阙折子戏
半阙折子戏 2020-12-18 00:18

In the documentation for android.support.v4.app.FragmentManager:

\"Static library support version of the framework\'s FragmentManager. Used to write apps that run on

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-18 00:57

    If you are using support Packages in your project or app, then you have to use getSupportFragmentManager because that is how you will return the fragmentManager for interacting with fragments associated with this activity. In the other hand, if you are not, then you can use getFragmentManager. It only depends on what you are using in your app.

提交回复
热议问题