ListFragment Support Library GetSupportFragmentManager undefined

前端 未结 2 939
深忆病人
深忆病人 2021-02-04 12:26

I have a list Fragment (importing the v4 support library, build target is 2.3.3 api 11) and the following problem in my code that was working fine when the target was 3.0 and I

2条回答
  •  不要未来只要你来
    2021-02-04 13:09

    You should use

    getActivity().getSupportFragmentManager()
    

    If that is still giving you problems, then makre sure that your Activity extends FragmentActivity.

    If that is still giving you problems,

    1. Delete all of your imports,
    2. Re-import with Ctrl + Shift + O, and
    3. On every name clash, make sure you import from support.v4.*, not android.*.

提交回复
热议问题