The highligted row in ListView doesn't remain highlighted after scrolling
I have created a listview with simplecursoradapter and made it to
Highlight when any of the item is clicked on it with the following code.
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="true"
android:drawable="@color/blue" />
<item
android:drawable="@color/white" />
</selector>
and on Item selected i have done as below.
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, final View view,
int position, long id)
{
view.setSelected(true);
}
It's working fine ,when i select the item in listview it get selected ,
But the problem is when i scroll the listview the item selected doesn't
remain highlighted.
No comments:
Post a Comment