Cannot convert from android.support.v4.app.Fragment to android.app.Fragment

后端 未结 8 1564
南笙
南笙 2020-12-10 00:41

I\'m doing my first Android app, and wanted to get straight into the ICS API. I have so far created an app using an ActionBar, with swipeable tabs using Viewpager and Fragme

8条回答
  •  独厮守ぢ
    2020-12-10 00:49

    look here:fragmentTransaction.add(R.id.main_container, new HomeFragment()); you add the fragment ,but follow,you use replace() method ,so you should use replace instead of add()

提交回复
热议问题