@Override public void onNavigationDrawerItemSelected(int position) { // update the main content by replacing fragments FragmentManager fragmentManager = getFragmentManager(); switch (position) { case 0: fragmentManager .beginTransaction() .replace(R.id.container, TrendingShowsFragment.newInstance(position + 1)) .commit(); break; case 1: // TODO Change the fragment fragmentManager .beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); break; case 2: // TODO Change the fragment fragmentManager .beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); break; default: fragmentManager .beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); break; } }
public static PlaceholderFragment newInstance(int sectionNumber) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; }
@Override public void onNavigationDrawerItemSelected(int position) { // update the main content by replacing fragments switch (position) { case 0: fragment = PlaceholderFragment.newInstance(position + 1); break; case 1: fragment = NoticiasFragment.newInstance(position + 1); break; case 2: fragment = CDFragment.newInstance(position + 1); break; case 3: fragment = ParquesFragment.newInstance(position + 1); break; case 4: Bundle bundle = new Bundle(); bundle.putBoolean("logged", logged); fragment = ReporteProblema.newInstance(position + 1); fragment.setArguments(bundle); break; case 5: fragment = SolicitudesFragment.newInstance(position + 1); break; } FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager.beginTransaction().replace(R.id.container, fragment).commit(); }
@Override public Fragment getItem(int position) { // getItem is called to instantiate the fragment for the given page. // Return a PlaceholderFragment (defined as a static inner class below). PlaceholderFragment instance = PlaceholderFragment.newInstance(position); return instance; }
@Override public Fragment getItem(int position) { if (position == 0) return cardsetPickerFragment; else if (position == 1) return cardsetRecentsFragment; // getItem is called to instantiate the fragment for the given page. // Return a PlaceholderFragment (defined as a static inner class below). return PlaceholderFragment.newInstance(position + 1); }
@Override public void onNavigationDrawerItemSelected(int position) { FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager .beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); }
@Override public void onNavigationDrawerItemSelected(int position) { // update the main content by replacing fragments // FragmentManager fragmentManager = getFragmentManager(); manager = getFragmentManager(); manager .beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); }
@Override public boolean onNavigationItemSelected(int position, long id) { // When the given dropdown item is selected, show its contents in the // container view. getSupportFragmentManager() .beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); return true; }
/** Returns a new instance of this fragment for the given section number. */ public static PlaceholderFragment newInstance(int sectionNumber) { PlaceholderFragment fragment = new PlaceholderFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); int id; switch (sectionNumber) { case 1: id = R.drawable.coke_zero_751ml; break; case 2: id = R.drawable.coke_zero_can; break; default: id = R.drawable.coke_zero_2l; break; } args.putInt(ARG_BACKGROUND_ID, id); fragment.setArguments(args); return fragment; }
/** Return instances of tabs as requested by the FragmentManager */ @Override public Fragment getItem(int position) { // getItem is called to instantiate the fragment for the given page. // Return a PlaceholderFragment (defined as a static inner class // below). switch (position) { case 0: return _connectTabFragment; case 1: return _playTabFragment; default: return PlaceholderFragment.newInstance(position + 1); } }
@Override public Fragment getItem(int position) { switch (position) { case 0: return MyPlaylistListFragment.newInstance( Constants.ARGUMENT_NEWS_ADDED, Constants.CATEGORY_NEWS); case 1: return MyPlaylistListFragment.newInstance( Constants.ARGUMENT_NEWS_ADDED, Constants.CATEGORY_ARTICLE); case 2: return MyPlaylistListFragment.newInstance( Constants.ARGUMENT_NEWS_ADDED, Constants.CATEGORY_STORY); } return PlaceholderFragment.newInstance(position); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } // TODO: Change Adapter to display your content mAdapter = new ArrayAdapter<DummyContent.DummyItem>( getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, DummyContent.ITEMS); }
@Override public Fragment getItem(int position) { // getItem is called to instantiate the fragment for the given page. // Return a PlaceholderFragment (defined as a static inner class below). String group; if (position == 1) { group = "Jones family"; } else if (position == 2) { group = "Shane's group"; } else if (position == 3) { group = "unkown"; } group = "unkown2"; return PlaceholderFragment.newInstance(position, group); }
@Override public void onNavigationDrawerItemSelected(int position) { Fragment objFragment = null; switch (position) { case 0: objFragment = new DrawerMenu1(); break; case 1: break; case 2: break; } // update the main content by replacing fragments FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager .beginTransaction() .replace(R.id.container, PlaceholderFragment.newInstance(position + 1)) .commit(); }
@Override public Fragment getItem(int position) { // getItem is called to instantiate the fragment for the given page. // Return a PlaceholderFragment (defined as a static inner class below). // return PlaceholderFragment.newInstance(position + 1); // This method needs to be changed to return the 3 different fragment types // for each type - if position = 0, list, = 1, QR, = 2, other list. // To change the type/number of tabs, change this switch (position) { case 0: return ProductListFragment.newInstance(position + 1); case 1: return QRFragment.newInstance(position + 1); case 2: return EventFragment.newInstance(position + 1); default: return PlaceholderFragment.newInstance(position + 1); } }
@Override public Fragment getItem(int position) { return PlaceholderFragment.newInstance(position + 1); }
@Override public void onAttach(Activity activity) { Log.d(TAG, "onAttach"); super.onAttach(activity); }
@Override public Fragment getItem(int position) { if (position == 1) { return new Chats(); } else return PlaceholderFragment.newInstance(position + 1); }