• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How to chnage the background drawable of the item in Listview when focussed?

Hi,
I am using a list view consisting of some items in list. each item has a default custom drawable(White tile) as background. i am using custom adapter to fill the data. in my custom adapter i am creating items(views) like i require by inflating the layout and assigning to perticular views.

here is the problem.
-------------------
I want to get the view(item) which is focussed in the listview and change the background(white tile) to (green color).

i tried these..
-----------------
1. while creating item in getview( ), setting onFocusChangeListener( ) for each item. ----didnt work, code didnt hit the onFocusChanged( ).
2. while creating item in getView( ), call isFocussed( ) and act acordingly.. I know this wont work and as expected it didnt.
3. I dont know is there any option in listItem layout file.. so i didnt try that..


Please help me in this.. thanks..
 
Back
Top Bottom