Error: required: android:support.v4.FragmentManager, found: android.app.FragmentManager

前端 未结 4 581
无人及你
无人及你 2021-01-22 12:47
 FragmentManager manager = getFragmentManager();

It is giving the error

required : android:support.v4.FragmentManager
foun

4条回答
  •  我在风中等你
    2021-01-22 13:43

    Use getSupportFragmentManager(), or change the import for FragmentManager from what you have (android.support.v4.app.FragmentManager) to android.app.FragmentManager.

    You need to consistently use either the native classes or the backport. You cannot mix and match.

提交回复
热议问题