android - Update fragment in ViewPager -
i have 2 fragments in viewpager , on 2nd fragment page have textview contains total of edittext's on both fragment pages. have code in onresume() method not called between swipes.
what easiest way update total in textview on 2nd fragment when values changed in first fragment.
i hoping simple 1 line job
for such behavior should make interface
between fragments
, define interface , make object(initialize getactivity()) of in first fragment , when event occured(changing data in first fragment) call function has been defined in interface , in parent activity implement interface , fragmentmanager pass changed value second fragment , update textview .
Comments
Post a Comment