java - how can i update recyclerview inside fragment when click from another recyclview? -


i've viewpager 2 fragment in each 1 recyclerview 1 take data json , other take sqlite db there favorite button in first recycler inserts db when swipe next fragment not updated want update in same time

use setuservisiblityhint function second fragmnet, call when fragment visible every time , inside can update adapter, when swipe fragment

@override     public void setuservisiblehint(boolean isvisibletouser) {         super.setuservisiblehint(isvisibletouser);         if (isvisibletouser) {                 data db , notify adapter here         }      } 

Comments

Popular posts from this blog

Add new key value to json node in java -

javascript - Highcharts Synchronized charts with missing data points -

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