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
Post a Comment