Focus problem with dpad

by tikky » Wed, 09 Dec 2009 01:08:08 GMT


Sponsored Links
 Hi,
I have a a simple activity with  a list view. Each element of the list
view contains a photo, text view and a button. I have an
onClickListener() implemented for the button.
When I touch the button, onClickListener gets called, which is what I
want. But when I use the D-PAD, and press down key, the entire list
item gets focus, so the center-select key takes no effect. I need the
focus to go only to the button instead of the entire list element, so
that when center key is pressed, it will do the same action as in the
touch mode.

How can I achieve this?
I have tried calling requestFocus() on the button, but still it does
not work.

--



Focus problem with dpad

by tikky » Tue, 22 Dec 2009 01:18:46 GMT


 I was able to get this working by calling:
list.setItemsCanFocus(true);

Now the button gets focus when navigating with D_PAD.
But now I face another issue.

The textview does not get highlighted when selected. Is there anyway I
can get the textview to be highlighted when focussing on it?

Kunal




--


Sponsored Links


Other Threads

1. Diapad phone red button press

Hi,


Has any has success of pressing the redbutton of the dialpad, which is
launched my their own application.

We want to do press read button from ActivityInstrumentationTestCase2
testses on our own application.


Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

-- 

2. why is there no android tablet nearly as good as ipad?

why is there no android tablet nearly as good as ipad?

-- 

3. Issues in downloading android source code(Repo init )

4. OOT: mhn petunjuk dan WTB

5. Best way to determine device capabilities, chipset, etc

6. Do VBOs really improve performance? Really?

7. Routing Audio to Bluetooth Headset API Level < 8