Code example for FragmentStatePagerAdapter

Methods: instantiateItem

		public Object instantiateItem(ViewGroup container, int position) {
			Object obj = super.instantiateItem(container, position);
			EfectViewPager.setObjectForPosition(obj, position);
			return obj;
		// ページ生成 
		public Fragment getItem(int position) {
			// getItem is called to instantiate the fragment for the given page. 
			// Return a DummySectionFragment (defined as a static inner class 
			// below) with the page number as its lone argument. 
			// getIntent().getStringExtra(ItemDetailFragment.ARG_ITEM_ID)); 
			Fragment fragment;
			if (position == 0)// 設定画面
				fragment = new SettingsFragment();
			else if (position == 1 && mTwoPane)// トップページ(タブレット用)
Stop searching for code, let great code find you!  Add Codota to your java IDE