Use
mListView.setItemsCanFocus(true); // <- true here
mListView.addFooterView(footer, null, true); // <- true here

Friedger


On 19 Aug., 09:49, Peli <[EMAIL PROTECTED]> wrote:
> I add a fooer to a list using the code below. It contains a button.
>
> I can press the button using "touch" (i.e. mouse click), but I can not
> put focus on the
> button using the key pad only.
>
> If I choose the 3rd parameter in addFooterView() to be "true" instead
> of "false", then I can select the whole footer view, but not the
> button in this view.
>
> How can I make the button selectable (without the whole footer view
> selectable)?
>
> Peli
>
> --- Code follows ---
>
> --------------
> mListView = (ListView) findViewById(R.id.mylist);
>
> // Add footer
> LayoutInflater inflater = (LayoutInflater)
> this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
> LinearLayout footer =
> (LinearLayout)inflater.inflate(R.layout.mylist_footer, null);
> mListView.addFooterView(footer, null, false);
> Button button = (Button) footer.findViewById(R.id.button);
> ------------
>
> and res/layout/mylist_footer.xml:
> -------------
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>         android:orientation="vertical"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>         <Button android:id="@+id/button"
>                 android:text="Add more"
>                 android:layout_width="wrap_content"
>                 android:layout_height="wrap_content"/>
>
> </LinearLayout>
> -------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to