例子链接:http://developer.android.com/reference/android/app/Fragment.html
中有一句:当时他继承Activity我使用的support.V4的包 如果继承Activity就不行了 没有这个方法,即:getFragmentManager().beginTransaction().add(Android.R.id.content, details).commit();
怎么办 ?我看过别人也提过同样问题:http://stackoverflow.com/questions/11208335/listfragment-support-library-getsupportfragmentmanager-undefined求高人帮组~~~FragmentgetFragmentManager
中有一句:当时他继承Activity我使用的support.V4的包 如果继承Activity就不行了 没有这个方法,即:getFragmentManager().beginTransaction().add(Android.R.id.content, details).commit();
怎么办 ?我看过别人也提过同样问题:http://stackoverflow.com/questions/11208335/listfragment-support-library-getsupportfragmentmanager-undefined求高人帮组~~~FragmentgetFragmentManager
如果是这样 我以前的app就不能改成这样了啊
我想把以前的APP也用这个来改写 用support那个包 ,可行么?
你可以不要继承Activity
而继承FragmentActivity
---------------
You should usegetActivity().getSupportFragmentManager()
If that is still giving you problems, then makre sure that your Activity extends FragmentActivity.If that is still giving you problems,Delete all of your imports,
Re-import with Ctrl + Shift + O, and
On every name clash, make sure you import from support.v4.*, not android.*.