private void selectItem(int position) {
    // update the main content by replacing fragments
    //        Fragment fragment = new PlanetFragment();
    //        Bundle args = new Bundle();
    //        args.putInt(PlanetFragment.ARG_PLANET_NUMBER, position);
    //        fragment.setArguments(args);
    //
    //        android.app.FragmentManager fragmentManager = getFragmentManager();
    //        fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();

    // update selected item and title, then close the drawer
    mDrawerList.setItemChecked(position, true);
    //        setTitle(mPlanetTitles[position]);
    mDrawerLayout.closeDrawer(mDrawerList);
  }
Пример #2
0
  private void updateItemSelected(DrawerListAdapter.DrawerItem drawerItem) {
    mDrawerList.setItemChecked(drawerItem.getPosition(), true);

    setTitle(drawerItem.getTitle());
  }