android - Changing the state of selector after list item has been pressed -


i've used list selector display different colours depending on the state (selected , otherwise). below listselector code:

//orange on selected <item android:drawable="@color/orange" android:state_selected="true"/>   //black otherwise <item android:drawable="@color/black"/> 

in main activity set view : view.setselected(true);

however after selecting list item, colour still orange.

does know how resolve this?

you using wrong state color, need use activated state.

check out question had on this

showing current selection in listview


Comments

Popular posts from this blog

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -

c# - Pausing a storyboard on TabItem mouse over -

c# - Attribute value in root node of xml Linq to XML -