How to keep android listview highlighted?

Use ListView.setChoiceMode(). The "highlight" is meant to disappear when the user touches the screen and trying to change this behavior would be bad for consistency. The choice mode was meant to address this.

ListView. SetChoiceMode(ListView. CHOICE_MODE_SINGLE); //doesnt work, when I highlight an item, the highlight disappears – Sheehan Alam Sep 3 '10 at 4:57 You cannot keep the highlight like I told you.

The choice mode lets you check an item. – Romain Guy Sep 3 '10 at 17:26.

I have two ListView in an XML, namely lvPrograms & lvEpisodes. They are placed horizontally. I fill these ListViews from a web service.

When the Activity loads, I call the web service to get data for lvPrograms. When I receive Programs, I then load the Episodes for the first program in the retrieved list. And set the lvPrograms's first item as selected/highlighted, to show user that the loaded Episodes are for this Program item.

I call this method when user clicks on PROGRAMS list item to highlight the item whose EPISODES are being loaded in lvEpisodes listview. It looks like the following image. Issues occur ONLY when the ListView has more items then its visible area.

So when I click the first item, it background is changed by the above code BUT some other item , which is among the invisible items, also changes the background. I think I have missed some thing OR handling the initially invisible list items is different. OR You can guide me to a way where I can declare a background selector for that item which is CLICKED ... and only the clicked item remain highlighted .. So if user clicks on some other item in the list which is among the hidden items, then that item becomes highlighted... so there must be a single HIGHLIGHTED item at any time in the list ... This will be great If its possible.

Any help is greatly appreciated as the release date is close.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions