java - Call notifyDataSetChanged() within Fragment -
i'm using viewpager in mainactivity.java
5 fragments.
now i've got problem.
running notifydatasetchanged()
works fine this:
viewpager.getadapter().notifydatasetchanged();
but how can run notifydatasetchanged()
fragment?
i have no idea.
what i've tried
making viewpager static , run
mainactivity.this.viewpager.getadapter().notifydatasetchanged()
doesn't work.
add method mainactivity
public void datachanged() { viewpager.getadapter().notifydatasetchanged(); }
and fragments call with
((mainactivity) getactivity()).datachanged();
Comments
Post a Comment