FragmentPagerAdapter getItem error with ListFragment

前端 未结 2 1851
青春惊慌失措
青春惊慌失措 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;
    

提交回复
热议问题