ViewPager works Fine at first time but on reloading again, getting the error java.lang.IllegalStateException?

前端 未结 2 1308
时光说笑
时光说笑 2020-12-16 00:56

I have a ViewPager with the 10 images comes through webservices(JSON), At first ViewPager work smoothly (fine).

but When back from the activity and reopen it

2条回答
  •  庸人自扰
    2020-12-16 01:52

    The answer they gave worked for a similar problem of mine.. I am just in production, have no idea how all these codes work, But what they said kind of helped me in the other thread of yours. You have to notify like they said, in the places where you set or delete your images.

    So, I think here your problem is that you have to make a notify after you onCreateView() and also in your destroyItem() .. I would add the already suggested solution here.. I guess that should do it.. hope I am not misguiding you.. good luck..

         slideShowPager.getAdapter().notifyDataSetChanged();
    

    td:lr; That line in two of your functions onCreateView() and destroyItem() in the end might do the trick

提交回复
热议问题