Hi, I have a layout which has a button and follow by a ListView. The problem I have with this is when the button has focus (background is orange), and I press DOWN in my keyboard, the first row of the ListView does not have a focus.
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageButton android:id="@+id/button" style="@android:style/Button"/>
</LinearLayout>
<ListView android:id="@+id/action_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
This is the layout of each row in the ListView:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:focusable="true"
><TextView android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
I have tried using the 'android:nextFocusDown' attribute, but that does not help my problem:
<ImageButton android:id="@+id/button" style="@android:style/Button"/>
</LinearLayout>
<ListView android:id="@+id/action_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:nextFocusUp="@id/button"
/>
Any idea how to fix this focus problem? I basically want to button move focus to the first row of the ListView when I press DOWN. and the first row of the ListView move focus to the button when I press UP.
Thank you.