title: Navigation drawer selecting zero index position and not working other positions
body: <p>I am creating an application in which I want to navigate different activities on the basis of selection of list view available drawer but it is just selecting zero position of list view and not even working other position number I tried a lot but no idea how to deal with it here is the code...</p>
  
  <pre><code>  public class NowPlaying extends Activity {
  
    private DrawerLayout mDrawerLayout;
    private ListView mDrawerList;
    private ActionBarDrawerToggle mDrawerToggle;
  
    private CharSequence mDrawerTitle;
    private CharSequence mTitle;
    private String[] mPlanetTitles;
    Intent drawerIntent;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.now_playing);
  
      mTitle = mDrawerTitle = getTitle();
      mPlanetTitles = getResources().getStringArray(R.array.playing_now_list);
      mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
      mDrawerList = (ListView) findViewById(R.id.left_drawer);
  
                   mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow,GravityCompat.START);
      set up the drawer's list view with items and click listener
      mDrawerList.setAdapter(new ArrayAdapter&lt;String&gt;(this,
              R.layout.drawer_list_item, mPlanetTitles));
      mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
  
      mDrawerToggle = new ActionBarDrawerToggle(
              this,
              mDrawerLayout,
              R.drawable.ic_drawer,
              R.string.drawer_open,
              R.string.drawer_close
      ) {
          public void onDrawerClosed(View view) {
             // getActionBar().setTitle(mTitle);
              invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
          }
  
          public void onDrawerOpened(View drawerView) {
           //   getActionBar().setTitle(mDrawerTitle);
              invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
          }
      };
      mDrawerLayout.setDrawerListener(mDrawerToggle);
  
      if (savedInstanceState == null) {
          selectItem(0);
      }
  }
  public boolean onPrepareOptionsMenu(Menu menu) {
  
      boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
      //menu.findItem(R.id.action_websearch).setVisible(!drawerOpen);
      return super.onPrepareOptionsMenu(menu);
  }
  
  
  
  private class DrawerItemClickListener implements ListView.OnItemClickListener {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
        selectItem(position);
  
      }
  }
  private void selectItem(int position) {
  
      mDrawerList.setItemChecked(position, true);
  
  
  
      /*switch(position){
  
          case 0:
             drawerIntent = new Intent(NowPlaying.this,MainActivity.class);
             startActivity(drawerIntent);
             break;
          case 1:
              drawerIntent = new Intent(NowPlaying.this,Artist.class);
              startActivity(drawerIntent);
              break;
          case 2:
          drawerIntent = new Intent(NowPlaying.this,Favorites.class);
          startActivity(drawerIntent);
          break;
          case 3:
              drawerIntent = new Intent(NowPlaying.this,Store.class);
              startActivity(drawerIntent);
              break;
          case 4:
              drawerIntent = new Intent(NowPlaying.this,Scan.class);
              startActivity(drawerIntent);
              break;
      }*/
  
      mDrawerLayout.closeDrawer(mDrawerList);
  }
  
  @Override
  protected void onPostCreate(Bundle savedInstanceState) {
      super.onPostCreate(savedInstanceState);
      // Sync the toggle state after onRestoreInstanceState has occurred.
      mDrawerToggle.syncState();
  }
  @Override
  public void onConfigurationChanged(Configuration newConfig) {
      super.onConfigurationChanged(newConfig);
      // Pass any configuration change to the drawer toggls
      mDrawerToggle.onConfigurationChanged(newConfig);
  }
  </code></pre>
  
  <p>public static class PlanetFragment extends Fragment {</p>
  
  <pre><code>public PlanetFragment() {
  
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      View rootView = inflater.inflate(R.layout.store, container, false);
      return rootView;
  }
  </code></pre>
  
  <p>}
  }</p>