incompatible types: HomeFragment cannot be converted to Fragment in Android

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

    import android.app.Fragment; works with getFragmentManager() method but before you have to remove the import android.support.v4.app.Fragment;

提交回复
热议问题