incompatible types: HomeFragment cannot be converted to Fragment in Android

后端 未结 9 1662
轻奢々
轻奢々 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:16

    In my case i have changed line-1 with line-2

    Line-1: import android.app.Fragment;

    Line-2: import android.support.v4.app.Fragment;

    Its working

提交回复
热议问题