I have two ListView
\'s in my Activity
, when i select one from first List
data will reflected to other list. I have done this part, its
Just set in your main layout of list item view
style="?attr/SelectableItemBackground"
You can do this by below -
Set the android:listSelector="@drawable/selection"
to your ListView's xml attribute. And, in your selection.xml
contains the selector which will hold the change when you select any item from listview.
selection.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:state_pressed="false"
android:drawable="@color/android_green" />
<item android:state_focused="true"
android:state_pressed="true"
android:drawable="@color/black_alpha" />
<item android:state_focused="false"
android:state_pressed="true"
android:drawable="@color/black_alpha" />
<item android:drawable="@color/white_alpha" />
</selector>
Have a look at this also.