title: Disabling items in a Navigation Drawer in Android
body: <p>I'm using the Navigation Drawer Example <a href="http://developer.android.com/training/implementing-navigation/nav-drawer.html" rel="nofollow noreferrer">downloadable here</a>.</p>
  
  <p>I'd like to extend this example to disable the selection of one of the planets. For simplicity, lets say I want to permanently disable the selection of Saturn, and change the text of Saturn to dark gray, and have it not highlight when a user selects it.   (in reality, I would like to disable navigation programmatically when a user has changed certain values on the screen not yet saved to the device). </p>
  
  <p>The closest thing I've gotten to this is to stop the <code>selectItem()</code> method from being called from within the <code>onItemClick</code> click listener, but an issue remains even if I do this - the text of "Saturn" still appears selectable and highlights when a user clicks it. </p>
  
  <p>What portion of the widgets do I need to change to prevent the text of Saturn from being highlighted?<br>
  I've tried changing</p>
  
  <pre><code>mDrawerLayout.setClickable(false);
  mDrawerList.setClickable(false);
  </code></pre>
  
  <p>But neither of these options appear to have any affect.</p>
  
  <p>Any suggestions or ideas as to how to approach this problem?
  A couple helpful notes: </p>
  
  <ol>
  <li>I'm aware that alternatively I can <a href="https://stackoverflow.com/questions/17051104/disable-swipe-gesture-to-open-navigation-drawer-in-android">Set the Drawer Lock Mode</a> to prevent the navigation drawer from being opened, but this is much less intuitive than having grayed out nav actions</li>
  <li>Is the more appropriate thing to do here to remove the items from the list that cannot be accessed at this time? Similar to as described in the <a href="https://stackoverflow.com/questions/2558591/remove-listview-items-in-android">Remove ListView implementation</a> here?  The biggest disadvantage to this is that I would probably have to change the listview to describe <em>why</em> items have been removed from this list temporarily.</li>
  </ol>