title: Android ListView listSelector not working
body: <p>I am trying to set a custom selector to a ListView. It's working fine on newer devices but not working on lower version of devices.I want the ListView selected item to be stay highlighted.</p>
  
  <p>Please help.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>ListView.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
          &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical" &gt;
  
              &lt;ListView
                  android:id="@+id/listViewBell"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:cacheColorHint="#00000000"
                  android:choiceMode="singleChoice"
                  android:divider="#b5b5b5"
                  android:dividerHeight="1dp"
                  android:listSelector="@drawable/list_selector_color" &gt;
  
              &lt;/ListView&gt;
  
          &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>list_selectror_color.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
      &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
          android:shape="rectangle" &gt;
  
          &lt;solid android:color="@color/list_selector" /&gt;
  
          &lt;stroke
              android:dashWidth="2dp"
              android:width="1dp"
              android:color="@color/white" /&gt;
  
      &lt;/shape&gt;
  </code></pre>
  
  <p>I have also tried with selector but nothing happens</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="@drawable/list_selector_color" android:state_pressed="true"/&gt;
      &lt;item android:drawable="@drawable/list_selector_color" android:state_focused="true"/&gt;
      &lt;item android:drawable="@drawable/list_selector_color" android:state_selected="true"/&gt;
      &lt;item android:drawable="@drawable/list_selector_normal"/&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p>Here is my Custom adapter getView Method</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
          LayoutInflater inflater = (LayoutInflater) mContext
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          convertView = inflater.inflate(R.layout.listview_bell_items, parent,
                  false);
  
          ImageView imageview = (ImageView) convertView
                  .findViewById(R.id.list_bell_image);
          imageview.setImageResource(mDataImage[position]);
  
          TextView textview = (TextView) convertView
                  .findViewById(R.id.txt_bell_title);
          textview.setText(mDataText[position]);
  
          return convertView;
      }
  </code></pre>