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

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -