java - Why notifyDataSetChanged not working on some devices? -
helo,
i've got viewpager 5 fragments.
my problem is, calling
viewpager.getadapter().notifydatasetchanged();
doesn't work on devices.
for example, on bq aquaris mobile phone works fine. refreshes 5 fragments.
but on huawei honor mobile phone refresh first fragment, , others left are.
how can avoid problem?
bq aquaris android version is: 7.1.1
huawei honor android version is: 7.0
you can try set viewpager.setoffscreenpagelimit
5 (see https://developer.android.com/reference/android/support/v4/view/viewpager.html#setoffscreenpagelimit(int) more information).
but not recommended hold lot of pages in memory. alternative use viewpager.addonpagechangelistener
, update corresponding fragment.
Comments
Post a Comment