Step1: Embbed the android:listSelector attribute in your ListView as Shown Below.
<ListView android:id="@+id/android:list" android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Tablayoutdesign"
android:cacheColorHint="#000000"
android:dividerHeight="1dip"
android:layout_marginTop="63dip"
android:layout_marginBottom="40dip"
/>
Step2: Create a new xml named listselector and put the following code in that
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Selected -->
<item
android:state_focused="true"
android:state_selected="false"
android:drawable="@drawable/focused"/>
<!-- Pressed -->
<item
android:state_selected="true"
android:state_focused="false"
android:drawable="@drawable/selected" />
</selector>
Step3: Create a file named colors.xml
add the following the code in that file
<resources>
<drawable name="focused">#ff5500</drawable>
<drawable name="selected">#FF00FF</drawable>
</resources>
Add this line in your java code
ListView lv= (ListView) findViewById(R.id.list);
lv.setSelector( R.drawable.listselector);