I have a listview in that i want when my activity starts then the first item will have background and the other items don\'t have any background.After that if the user selec
For doing this what you can do is create a selector and apply it to parent view of your row.xml
Define color in strings.xml
Create a selector
Now apply it as android:background="@drawable/row_selector" for parent view of your row.
Set ListView as CHOICE_MODE_SINGLE in java code
listview.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
And finally setAdapter to your ListView.
listview.setAdapter(adapter);
For selection of default item in ListView use,
listview.setItemChecked(position, true);
I had created a demo example for the same you can download it from my github