getSupportFragmentManager() versus getFragmentManager() in android 3.0+

后端 未结 3 451
半阙折子戏
半阙折子戏 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条回答
  •  醉梦人生
    2020-12-18 01:00

    There's nothing wrong with using getSupportFragmentManager() on Android 3.0+ as long as you have the support library imported. If you want to use getFragmentManager() for SDKs 11+, go for it; just keep in mind that you may be if/elseing a lot of code with version checks.

提交回复
热议问题