Android Question CustomListView - Clear Selection?

aregan

Member
Licensed User
Hi

I'm using a CustomListView to allow select / navigate to a record.
We've set the CustomListView.PressedColor to a light blue to highlight the selection and give the user feedback.

When an item on the CustomListView is pressed a call is made to service which then causes a new activity to be shown, however when they return to prevous Activity with the CustomListView the selected item is still the PressedColor, and every other item thats pressed also is set to the PressedColor.

So, without calling the CLEAR method and loading the CustomListView, how can we unselect or clear the selection so that the ListView panel items background color is restored to normal
 

mangojack

Well-Known Member
Licensed User
Normally the clv pressed color is only a temporary event ... have you coded to change the item panel color for the selected item ?

anyway .. knowing the index of selected item , you could reset selection of item prior to loading new activity.
B4X:
CustomListView.GetPanel(Index).Color = Colors.White
but you also mention ...
and every other item thats pressed also is set to the PressedColor.
So you might need to loop thru the CLV and apply that code to all items.
 

Erel

Administrator
Staff member
Licensed User
Two options:
1. Add Sleep(250) before you start the next activity.
2. Set the pressed color to transparent and handle the selection color yourself in ItemClick event.
 
Top