title: How to Change the list selected item color in the navidgation drawer?
body: <p>I am starting from the Android Studio example of navigation browser. I'm customizing everything i want, all is ok but i can't find how to change the selected item color in the navigation drawer... For now it's green and i don't manage to change that.</p>
  
  <p>I tried with a selector drawable but no way, i managed to change the whole background but not juste the selected one.</p>
  
  <p>Sorry if it's a noob question but i spent hours yesterday on google and here without finding :/</p>
  
  <p><img src="https://i.stack.imgur.com/6Jwyj.jpg" alt="Green color i want to change"></p>
  
  <hr>
  
  <p><strong>Finally, i managed to make it work.</strong>
  The problem was the "android.R.layout.simple_list_item_activated_1".</p>
  
  <p>It's an android built in xml so you can't deal with colors you want.</p>
  
  <p>So i created a file named <code>nav_drawer_layout.xml</code> containing the same as the "android.R.layout.simple_list_item_activated_1" file.</p>
  
  <p>Then i tweaked it changing the <strong>android:background</strong> attribute like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@android:id/text1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceListItemSmall"
      android:gravity="center_vertical"
      android:paddingStart="?android:attr/listPreferredItemPaddingStart"
      android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
      android:background="@drawable/nav_drawer_colors"
      android:minHeight="?android:attr/listPreferredItemHeightSmall" /&gt;
  </code></pre>
  
  <p>It refers to the the <code>nav_drawer_colors.xml</code> <strong>selector</strong> that you have to create:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:drawable="@color/selected_drawer" android:state_activated="true" /&gt;
      &lt;item android:drawable="@color/selected_drawer" android:state_selected="true" /&gt;
      &lt;item android:drawable="@color/pressed_drawer" android:state_pressed="true" /&gt;
      &lt;item android:drawable="@color/backgroung_drawer" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>selected_drawer, pressed_drawer and backgroung_drawer are defined in the values\colors.xml as always.</p>
  
  <p><strike>Now all is ok, except the shadow effect that works everywhere but not in the listview ^^</strike>
  EDIT: just specify a background color in the fragment navigation drawer layout (fragment_navigation_drawer.xml) and remove the
  <code>&lt;item android:drawable="@color/backgroung_drawer" /&gt;</code> in the <code>nav_drawer_colors.xml</code> file :)</p>
  
  <p><em>Hope that it will help others who have the same problem :)</em></p>