title: How do I make a specific item in the navigation drawer to appear as selected?
body: <p>I have been frustrated with this problem for quite a while, but I can't seem to make an item in the navigation drawer to appear as selected neither programmatically nor when the user selects it.</p>
  
  <p>I am trying to achieve the following
  <a href="http://i.stack.imgur.com/PIHEm.png">http://i.stack.imgur.com/PIHEm.png</a> (I cannot post images yet)</p>
  
  <p>I have followed the example navigation drawer at <a href="http://developer.android.com/training/implementing-navigation/nav-drawer.html">http://developer.android.com/training/implementing-navigation/nav-drawer.html</a>
  and whenever I switch fragments, I call <code>setItemChecked()</code> on the navigation drawer's <code>ListView</code></p>
  
  <p><code>mDrawerListView.setItemChecked(position, true);</code>, but it does not seem to select the item at the position in the listview.</p>
  
  <p>My layout file is also almost exactly like Google's example</p>
  
  <pre><code>&lt;android.support.v4.widget.DrawerLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
      &lt;ListView 
          android:id="@+id/left_drawer"
          android:layout_width="160dp"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:choiceMode="singleChoice"
          android:divider="@android:color/transparent"
          android:dividerHeight="0dp"
          android:background="#e5e5e5" /&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>Any help is appreciated greatly, and thanks in advance.</p>
  
  <p>EDIT: Here is my initialization code for the nav-drawer. As you can see, I am not using a custom ListView or Adapter.   </p>
  
  <pre><code> private void setUpDrawer() {
          mDrawerListViewItems = getResources().getStringArray(R.array.drawer_list_item_names);
          mDrawerListView = (ListView) findViewById(R.id.left_drawer);
          mDrawerListView.setAdapter(new ArrayAdapter&lt;String&gt;(this,
                  R.layout.drawer_list_item, mDrawerListViewItems));
  
          mDrawerListView.setOnItemClickListener(new ListView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
                  selectCounterFragment(position);
              }
          });
  
          mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
          mDrawerToggle = new ActionBarDrawerToggle(
                  this,                  /* host Activity */
                  mDrawerLayout,         /* DrawerLayout object */
                  R.drawable.ic_drawer,  /* nav drawer icon to replace 'Up' caret */
                  R.string.drawer_open,  /* "open drawer" description */
                  R.string.drawer_close  /* "close drawer" description */
                  );
  
          // Set actionBarDrawerToggle as the DrawerListener
          mDrawerLayout.setDrawerListener(mDrawerToggle);
  
          // styling option add shadow the right edge of the drawer
          mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
      }
  </code></pre>
  
  <p>Thank you all, for the responses so far.</p>