obj Fragment wrong 2nd argument type found 'Android.support.V4.app.Fragment.' required 'Android.app.Fragment'

前端 未结 4 1262
醉梦人生
醉梦人生 2020-12-30 21:50

I can\'t work out why my objFragment is giving me issues with the support manager, I\'m getting this error:

 Error:(101, 17) error: no suitable method found         


        
4条回答
  •  遥遥无期
    2020-12-30 22:06

    Below is the answer to a similar question I found while searching the internet. This worked for me, so I hope it will help you.

    Menu_Fragment is not inheriting from android.support.v4.app.Fragment. Presumably, it is inheriting from android.app.Fragment.

    There are two fragment implementations: the native one (e.g., android.app.Fragment) and the backport (e.g., android.support.v4.app.Fragment). You need to be consistent. Your activity is a FragmentActivity, which is part of the backport, so you need your fragments to inherit from android.support.v4.app.Fragment.

提交回复
热议问题