Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Posted

1 solution

 
Share this answer
 
Comments
xirokx 23-Jul-14 16:44pm    
thanks

list.setOnItemClickListener(new OnItemClickListener(){

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


view.setBackgroundColor(Color.CYAN);


}

});


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?

thank

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900