title: Multiple ViewPagers in on Activity
body: <p>I am trying to implement more than one ViewPager in one activity and it is not really working. What's the best way to implement that. I am stuck!!</p>
  
  <p>This is The Activity</p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.support.v4.view.PagerAdapter;
  import android.support.v4.view.ViewPager;
  import android.widget.Button;
  
  import com.viewpagerindicator.CirclePageIndicator;
  
  public class NewWorkoutActivity extends Activity{
  
      ViewPager corePager;
      ViewPager timePager;
      ViewPager equipmentPager;
      CirclePageIndicator coreIndicator;
      CirclePageIndicator timeIndicator;
      CirclePageIndicator equipmentIndicator;
      Button startWorkoutButton;
  
      PagerAdapter coreAdapter;
      PagerAdapter timeAdapter;
      PagerAdapter equipmentAdapter;
  
       String[] timeSets;
       String[] coreTargets;
       String[] equipments;
  
       int[] timeImages;
       int[] coreImages;
       int[] equipmentImages;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.new_workout);
  
  
           coreTargets = new String[] { "Full body", "Core",
                   "Legs", "Upper Body"};
  
           coreImages = new int[] { R.drawable.button_target_core,  R.drawable.button_target_core2,
                   R.drawable.button_target_core3,  R.drawable.button_target_core4};
  
           timeSets = new String[] { "15 Minutes", "20 Minutes", 
                   "30 Minutes", "45 Minutes"};
  
           timeImages = new int[] { R.drawable.button_target_core,  R.drawable.button_target_core2,
                   R.drawable.button_target_core3,  R.drawable.button_target_core4};
  
            equipments = new String[] { "Rope", "Kette Bell",
                   "Weight", "Hat"};
  
           equipmentImages = new int[] { R.drawable.button_target_core,  R.drawable.button_target_core2,
                   R.drawable.button_target_core3,  R.drawable.button_target_core4};
  
  
  
          startWorkoutButton=(Button)findViewById(R.id.startWorkoutButton);
          corePager=(ViewPager)findViewById(R.id.corepager);
          timePager=(ViewPager)findViewById(R.id.timepager);
          equipmentPager=(ViewPager)findViewById(R.id.equipmentpager);
          coreIndicator=(CirclePageIndicator)findViewById(R.id.coreindicator);
          timeIndicator=(CirclePageIndicator)findViewById(R.id.timeindicator);
          equipmentIndicator=(CirclePageIndicator)findViewById(R.id.equipmentindicator);
  
             coreAdapter = new MyViewPagerAdapter(NewWorkoutActivity.this, coreTargets, coreImages);
              // Binds the Adapter to the ViewPager
              corePager.setAdapter(coreAdapter);
  
              timeAdapter = new MyViewPagerAdapter(NewWorkoutActivity.this, timeSets, timeImages);
              // Binds the Adapter to the ViewPager
              timePager.setAdapter(timeAdapter);
  
              equipmentAdapter = new MyViewPagerAdapter(NewWorkoutActivity.this, equipments, equipmentImages);
              // Binds the Adapter to the ViewPager
              corePager.setAdapter(coreAdapter);
  
              // ViewPager Indicators
  
              coreIndicator.setViewPager(corePager);
              equipmentIndicator.setViewPager(equipmentPager);
              timeIndicator.setViewPager(timePager);
  
      }
  
  }
  
  
  
  
  
  and My Adapter
  
  
  
  
  
  import android.content.Context;
  import android.support.v4.view.PagerAdapter;
  import android.support.v4.view.ViewPager;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ImageView;
  import android.widget.RelativeLayout;
  import android.widget.TextView;
  
  public class MyViewPagerAdapter extends PagerAdapter {
      // Declare Variables
      Context context;
      String[] desc;
      int[] image;
      LayoutInflater inflater;
  
      public MyViewPagerAdapter(Context context, String[] desc,  int[] image) {
          this.context = context;
          this.desc = desc;
          this.image = image;
      }
  
      @Override
      public int getCount() {
          return desc.length;
      }
  
      @Override
      public boolean isViewFromObject(View view, Object object) {
          return view == ((RelativeLayout) object);
      }
  
      @Override
      public Object instantiateItem(ViewGroup container, int position) {
  
          // Declare Variables
          TextView desctext;
          ImageView vpimage;
  
          inflater = (LayoutInflater) context
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          View itemView = inflater.inflate(R.layout.body_page, container,
                  false);
  
          // Locate the TextView in viewpager_item.xml
          desctext = (TextView) itemView.findViewById(R.id.vptext);
  
          // Capture position and set to the TextViews
          desctext.setText(desc[position]);
  
          // Locate the ImageView in viewpager_item.xml
          vpimage = (ImageView) itemView.findViewById(R.id.vpimage);
          // Capture position and set to the ImageView
          vpimage.setImageResource(image[position]);
  
          // Add viewpager_item.xml to ViewPager
          ((ViewPager) container).addView(itemView);
  
          return itemView;
      }
  
      @Override
      public void destroyItem(ViewGroup container, int position, Object object) {
          // Remove viewpager_item.xml from ViewPager
          ((ViewPager) container).removeView((RelativeLayout) object);
  
      }
  }
  </code></pre>
  
  <p>The logcat is telling me that the ViewPagers don't have adapter instances.</p>