1

I don't know how to add RecyclerView in ViewPager. I have a RecyclerView which contain data fetched from web service. I need to swipe the main layout which contain the recyclerview and RecyclerView's data should be change accordingly to web service which will be called on each swipe(left or right).and there is no limit of pages like we changes the year in calendar.

I want to know how I will set RecyclerRiew in ViewPager ?

Ritz
  • 181
  • 1
  • 1
  • 10
  • Possible duplicate of [ViewPager update fragment on swipe](http://stackoverflow.com/questions/20412379/viewpager-update-fragment-on-swipe) – yennsarah Nov 05 '15 at 14:06
  • The ViewPager is connected to a FragmentPagerAdapter that will provide fragments when the ViewPager is swiped. So you just need a Fragment subclass that has a RecyclerView as part of its view. The fragment will probably also have the adapter for RecyclerView so you have to figure out how to get the data into the Fragment when it is created. – kris larson Nov 05 '15 at 16:58
  • thanks kris I solved half of the problem with your guidance Now I am able to create infinite ViewPager,But now the problem is I am unable to update the view.Problem is something like this : when I swipe the view pager left or right the view come back to the first view. – Ritz Nov 06 '15 at 08:45

0 Answers0