title: Carousel in android
body: <p>I am doing an android project using carousel.It should have different images while sliding..My project needs to have multiple carousel in a single page..how am i supposed to do that..I have already searched net and tried almost all links...but nothing is what I am looking for..So please help me in the following</p>
  
  <ul>
  <li>How to use different images in a carousel</li>
  <li>How to use multiple vertical carousel in a single page</li>
  </ul>
  
  <p>Can somebody please help me?</p>
  
  <p>This is a fragment of the code I am using</p>
  
  <p>super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);</p>
  
  <pre><code>    pager = (ViewPager) findViewById(R.id.myviewpager);
  
      adapter = new MyPagerAdapter(this, this.getSupportFragmentManager());
      pager.setAdapter(adapter);
      pager.setOnPageChangeListener(adapter);
  
      // Set current item to the middle page so we can fling to both
      // directions left and right
      pager.setCurrentItem(FIRST_PAGE);
  
      // Necessary or the pager will only have one extra page to show
      // make this at least however many pages you can see
      pager.setOffscreenPageLimit(3);
  
      // Set margin for pages as a negative number, so a part of next and
      // previous pages will be showed
      pager.setPageMargin(-200);
  </code></pre>