Android Question [StateListDrawable] Check mark in standard list view.

T201016

Active Member
Licensed User
Longtime User
Hello.
How do I get rid of the previous selection in the standard list view before creating a new list? I noticed that the selection from the previous selection sometimes remains out of the list (in case the list contains fewer items).
Greetings.

I normally use StateListDrawable:

B4X:
Dim CDPressed, CDNormal As ColorDrawable
CDPressed.Initialize (Colors.Gray, 0) 'Normal color CDNormal.Initialize (Colors.Yellow, 0)' Selected color
Dim SLD As StateListDrawable
SLD.Initialize
SLD.AddState (SLD.State_Pressed, CDPressed)
SLD.AddState (-SLD.State_Pressed, CDNormal)
Dim LVO As JavaObject = ListView1
LVO.RunMethod ("setSelector" ArrayAsObject (SLD))
 
Top