Hey Mike,

Did you ever get this working?? I need to do something similar in an
app I'm trying to put together.  I need the highlight from a touch on
a ListActivity row to remain highlighted after the touch.

Thanks so much,
Ben

On Jul 8, 8:14 am, mike <[email protected]> wrote:
> I'm having trouble with a list Activity, and selected items.
> Basically, when I move the wheel ball (i select an item without
> touch), then the background of the list item will highlight an orange,
> then I click my corresponding button below and it acts upon the
> selected item. I also want the user to be able to press with their
> finger once, and highlight the item, however, when I touch, it just
> highlights it orange and then back to normal. I know it's calling the
> onListItemClicked. I tried to set the position from that as
> this.setSelected(position), but that doesn't make the background stay
> a constant orange.
>
> Here's my xml that the ListActivity uses
>
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>                           android:orientation="vertical"
>                           android:layout_width="fill_parent"
>                           android:layout_height="fill_parent">
>         <ListView
>         android:id="@+id/android:list"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         android:layout_weight="1" />
>         <TextView
>                 android:id="@+id/android:empty"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         android:text="No Items." />
>     <LinearLayout
>         android:id="@+id/buttons"
>         android:orientation="horizontal"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>         <ImageButton
>                 android:id="@+id/editButton"
>                         android:layout_width="fill_parent"
>                         android:layout_height="46dip"
>                         android:layout_weight="1"
>                         android:src="@android:drawable/ic_menu_edit" />
>                 <ImageButton
>                 android:id="@+id/deleteButton"
>                         android:layout_width="fill_parent"
>                         android:layout_height="46dip"
>                         android:layout_weight="1"
>                         android:src="@android:drawable/ic_menu_delete" />
>     </LinearLayout>
> </LinearLayout>
>
> I've been googling, and reading about people who have similar (but not
> exactly the same problem) as me, and none of their solutions worked.
> If its important, I'm populating this listview with a custom extension
> of ArrayAdapter<MyCustomObj>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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