title: Selected list item color moves on scrolling the listView in Android
body: <p>In my Android application I am using listview. The code for list view is as follows</p>
  
  <pre><code> &lt;ListView
      android:id="@+id/inputselect_listview"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:choiceMode="singleChoice"
      android:footerDividersEnabled="true"
      android:headerDividersEnabled="true"
      android:listSelector="@drawable/list_selector"
      android:splitMotionEvents="true" &gt;
   &lt;/ListView&gt;
  </code></pre>
  
  <p>When user selected one item from the listview then background color of list item changes according to this line</p>
  
  <pre><code>android:listSelector="@drawable/list_selector"
  </code></pre>
  
  <p>EDIT: list_selector.xml</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:state_window_focused="false" android:state_selected="true"
      android:drawable="@android:color/transparent" /&gt;
  &lt;item android:state_selected="true"
      android:drawable="@android:color/transparent" /&gt;
  &lt;item android:state_pressed="true" android:state_selected="false"
      android:drawable="@android:color/transparent" /&gt;
  &lt;item android:state_selected="false"
      android:drawable="@color/blue_train" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>list_selector.xml is in drawable folder to specify color.
  Now the problem is that when I select one item from listview and scrolls the list then selected item background color also move downward/upward according to scrolling.
  Please provide me solution so that selected item background color remains as it is on scrolling.</p>
  
  <p>EDIT:Here the screenshot of scrolling listview by selecting single item.Blue color remains as it is</p>
  
  <p><img src="https://i.stack.imgur.com/otMu3.png" alt="enter image description here"></p>
  
  <p>Please advice.</p>