I have several fragments. I want them to come one after another as ViewPager
. If i swipe right then a fragment will be destroyed storing a value "yes" and if i swipe left it will destroy storing a value "no" and next fragment will appear. I tried FragmentStatePagerAdapter
but not getting desired result. I have google a lot but unable to do as I want.
Suppose I have 3 fragments 1,2,3. 1 is the first fragment. If I swipe right/left fragment 1 will destroy storing a value and fragment 2 will appear, and so on. When swiping to last fragment, a Dialog box will pop up with completion message.