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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -