incompatible types: HomeFragment cannot be converted to Fragment in Android

后端 未结 9 1685
轻奢々
轻奢々 2020-12-01 15:57

I\'m getting an error in this part of code:

private void displayView(int position) {
    // update the main content by replacing fragments
    Fragment fragm         


        
9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 16:14

    In Android Studio 2.3 getSupportFragmentManager works with android.support.v4.app but android studio 3.1 you have to use getFragmentManager enter image description here

提交回复
热议问题