问题
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