Code example for ViewPager

Methods: addView

0
	        } 
			 
			public Object instantiateItem(View collection, int position){
				android.support.v4.view.ViewPager viewPager = (android.support.v4.view.ViewPager)collection;
				View view = mAdapter.getView(position, null, viewPager);
				viewPager.addView(view);
				 
				return view;
			} 
 
			@Override 
            public void destroyItem(View container, int position, Object object) {
				android.support.v4.view.ViewPager viewPager = (android.support.v4.view.ViewPager)container;
				viewPager.removeView((View)object);
	            return; 
            } 
		} 
}