Code example for PagerAdapter

Methods: getActivity

0
			return view.equals(object);
		} 
 
		@Override 
		public Object instantiateItem(ViewGroup container, int position) {
			TextView text = new TextView(getActivity());
			text.setText(titles[position]);
			container.addView(text);
			return text;
		} 
 
		@Override 
		public void destroyItem(ViewGroup container, int position, Object object) {
			if (object instanceof View) {
				container.removeView((View) object);
			} 
		} 
 
		@Override 
		public CharSequence getPageTitle(int position) {
			return titles[position];