title: How to add multiple contents in view pager?
body: <p>Hi I am working with android apps.I had created a swipeable view using view pager which contains only images at the right end. Now I want to add some textviews and buttons in the same page viewer for each view. How can I add text views and buttons along with page viewer ???
  here is my code </p>
  
  <p>Swipe_adapter.java</p>
  
  <pre><code>  public class Swipe_adapter extends PagerAdapter {
    Context context;
    private int[] GalImages = new int[] {
    R.drawable.app1,
    R.drawable.app2,
    R.drawable.gosms
    };
  
      ArrayList&lt;HashMap&lt;String,String&gt;&gt; list=new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
      Map map=new HashMap ();
  
     String[] str=new String[]
                          {
           "app1","app2","app3"
  
                          };
  
     Swipe_adapter(Context context){
     this.context=context;
    }
    @Override
     public int getCount() {
      return GalImages.length;
     }
  
    @Override
    public boolean isViewFromObject(View view, Object object) {
      return view == ((ImageView) object);
  
    }
  
    @Override
    public Object instantiateItem(ViewGroup container, int position) {
    ImageView imageView = new ImageView(context);
    int padding = context.getResources().getDimensionPixelSize(R.dimen.padding_medium);
    imageView.setPadding(padding, padding, padding, padding);
    imageView.setScaleType(ImageView.ScaleType.FIT_END);
    imageView.setImageResource(GalImages[position]);
    ((ViewPager) container).addView(imageView, 0);
    return imageView;
    }
  
    @Override
     public void destroyItem(ViewGroup container, int position, Object object) {
      ((ViewPager) container).removeView((ImageView) object);
    }
    }
  </code></pre>
  
  <p>here is my Fragment class</p>
  
  <pre><code>    public class FeaturedFragment extends Fragment {
  
        @Override
       public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
          View rootView = inflater.inflate(R.layout.fragment_featured, container, false);
          ViewPager viewPager = (ViewPager)rootView.findViewById(R.id.view_pager);
           Swipe_adapter adapter = new Swipe_adapter(getActivity());
           viewPager.setAdapter(adapter);
  
          return rootView;
       }
    }
  </code></pre>