1. Download our Official Android App: Forums for Android!

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

Discussion in 'Android Apps & Games' started by arun160411, Sep 6, 2010.

  1. arun160411

    arun160411 Lurker
    Thread Starter

    Sep 6, 2010
    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..


Share This Page