1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

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


Last Updated:

  1. arun160411

    arun160411 New Member This Topic's Starter

    Joined:
    Sep 6, 2010
    Messages:
    1
    Likes Received:
    0
    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..
     

    Advertisement

Share This Page

Loading...