In my Android application, I have a GridView layout with a set of buttons. The problem is that I canβt set the focus correctly (I mean the cursor controlled by the joystick on the Android device) on the buttons. I can describe my problem with the image:

I set the buttons in the GridView dynamically in the BaseAdapter code using a LayoutInflater. In the code, I set the button text, image (CompoundDrawable) and background color, because my buttons work like checkboxes (blue background icons are checked).
It seems that the program focuses the grid field, not the button itself. I mean something like a table cell, not a button in a table. Since the default focus color is (green), I set the color blue to the selector. Focus pressing also does not work. And the focus is obviously behind the button, from beyond the borders of the buttons. Can someone help me with this problem please? The code for my XML layouts is:
main.xml:
... <GridView android:id="@+id/channels" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="6dip" android:verticalSpacing="10dip" android:horizontalSpacing="10dip" android:numColumns="auto_fit" android:columnWidth="60dip" android:stretchMode="columnWidth" android:gravity="center" android:background="@color/container_main"> </GridView> ...
channel.xml:
<Button android:id="@+id/channel" android:layout_height="fill_parent" android:layout_width="fill_parent" android:gravity="center_horizontal" android:background="@color/willBeSetInAdapter" <!-- white/blue/darkblue focus background --> android:drawableTop="@drawable/willBeSetInAdapter" <!-- icon --> android:drawablePadding="0dip" android:text="WillBeSetInAdapter" <!-- label text --> android:textColor="@color/text_container_main" android:textSize="12sp" android:focusable="true" android:focusableInTouchMode="false"> </Button>
I tried to set the focus parameters in Button as well as in GridView and tried a lot of things, but unfortunately it still does not work :(
source share