java.lang.IllegalStateException: Can't change tag of fragment

后端 未结 6 1161
情书的邮戳
情书的邮戳 2020-12-05 07:39

Hi i am getting this error while using a pageViwer and Adapter to slide across 3 fragments.

here is my pageAdapter

public class FreedomPageAdapter ex         


        
6条回答
  •  情深已故
    2020-12-05 08:09

    The following method should return one fragment for each tab:

    @Override
    public Fragment getItem(int position) {
        //Add some code
        //to verify that it will not return null
        return listFragment.get(position);
    }
    

    The code is fine, but make sure that the listFragment contains three different Fragment's, and the fragment is not null.

提交回复
热议问题