0

My question is similar to this one, Android - horizontal scrolling of multiple viewable items. Unfortunately, still could not get the right answer.

I dont want to use HorizontalScrollView as it does not free up the native memory, which is causing me OutOfMemoryError.

Community
  • 1
  • 1
Harshal Kshatriya
  • 5,630
  • 11
  • 44
  • 60

1 Answers1

1

How to create a custom page in ViewPager in which each page has 3 ImageViews( it could vary)?

Step #1: Design a fragment that "has 3 ImageViews( it could vary)"

Step #2: Create a FragmentStatePagerAdapter that creates pages based on the fragment from step #1

Step #3: Create a ViewPager and hand it an instance of your adapter from step #2

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks CommonsWare!! I'm creating the fragment with the required number of imageviews in `getItem` method from `FragmentPagerAdapter`. It works. :) – Harshal Kshatriya May 04 '12 at 11:59