FragmentPagerAdapter getItem error with ListFragment

前端 未结 2 1852
青春惊慌失措
青春惊慌失措 2021-02-09 06:58

I\'ve looked at quite a lot of code and can\'t figure this out. http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html

It has to be som

相关标签:
2条回答
  • 2021-02-09 07:45

    I think you will have to typecast to fragment before returning. So try this

    Fragment history = HistoryFragment.newInstance(i);
    return  history;
    
    0 讨论(0)
  • 2021-02-09 07:50

    I figured it out after getting some sleep. I was importing android.app.ListFragment instead of android.support.v4.app.ListFragment

    0 讨论(0)
提交回复
热议问题