I have A ViewPager
which have three fragments attached to it. Each fragment has a form which user need to fill out. On last page(Fragment) there is an update button which send the data to server. So I need to collect the data from First and second fragment and get it back in third fragment so that I can send the data to server.
To do that I have just defined Interfaces in first and second fragment which send the data to parent FragmentActivity
of-course I have implemented these Interfaces in FragmentActivity
. These method save the data in FragmentActivity so that I can get this data in third fragment.
For this I need a callback on swipe so when user swipe from form-1 and form-2 I can send the data to parent FargmentActivity
.
Now I don't know when to call these method so that the form-1 and form-2 data in first and second fragment get saved in parent `FragmentActivity'. I have tried all callback method in Fragment but no method get called when user swipe. Any Help would be Appreciated.