Click here to Skip to main content
14,644,170 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hey friends,

I have a simple list view that gets filled from my sql database with a list of names - this part is done , tested and it works.

Now I need to do add a handler on each listitem, please can you help me do this? Ideally I would like the listitem to turn orange when clicked.

Each listview item represents a name of a music track that when the user clicks should open up streamingmedia player and play the item preferably as a service so it remains open.

Each track is stored on a server which I store the weblink of in my database.

Please help thanks

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

xirokx 23-Jul-14 16:44pm

list.setOnItemClickListener(new OnItemClickListener(){

public void onItemClick(AdapterView<!--?--> parent, View view, int position, long id){




thats my code

when I click, the list item background color changes to CYAN

however the list item remains as CYAN after my click and I just want it to show CYAN on click and its default colour which is black when its not being clicked.

Basically, I am trying to implement a rollover on a list item, on click change color to cyan then change to default color.

any ideas how i can acheive this?


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100