Focus problem with dpad

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

Sponsored Links
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:

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?



Sponsored Links

Other Threads

1. Which is excellent XMPP server for Android.

Which is excellent XMPP server for Android.

2. Android on Samsung Blackjack 2

Can Android be installed on Blackjack 2?  If so could you please guide
in the right direction..



3. Error message is displayed while building android application

4. Is there anyway to rebuild the opencore shared library without rebuilding the whole source tree?

5. An issue about buying dev phone

6. Anyone received Dev Phone 1?

7. Building on Ant