ListView with TextFilter

by vincent.gann...@gmail.com » Fri, 06 Mar 2009 22:00:30 GMT


Sponsored Links
 Hi all,

I have a ListView with the text filter enabled plus an
OnItemClickListener. I don't understand how to find out which item
from my initial list was clicked because in void onItemClick
(AdapterView <?> parent, View v, int position, long id) position gives
the current position of the clicked item (after filtering) which is
NOT the initial position of this item in the list.

Any way to do it? I would be disapointed if we should do the filtering
ourselves in the same time in the corresponding ListAdapter...

Thanks.
--~--~---------~--~----~------------~-------~--~----~



ListView with TextFilter

by Romain Guy » Sat, 07 Mar 2009 00:44:33 GMT


 Filtering happens in the adapter at the same time. All you have to do
is use the position parameter to ask the adapter for the item at that
position.

On Fri, Mar 6, 2009 at 6:00 AM, vincent.gann...@gmail.com





-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


ListView with TextFilter

by vincent.gann...@gmail.com » Sat, 07 Mar 2009 00:54:32 GMT


 It works! Great! Thanks Romain :-)
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Knwon issues and limitations on running Android applications on Android 2.1 smartphone

We would like to gather some general known issues and limitations on
running Android applications on Android 2.1 mobile phone. eg. memory
issues, battery usage, ..etc; since there is only limited information
from   developer.android.com/guide/practices/design/

-- 

2. TextView visibility problem

Hi guys,

the code I pasted below works great with the exception of the last
view - the textView.

The TextView does not display:

<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/LinearLayout01"
        android:background="@drawable/bkgrnd"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
        <RelativeLayout
                android:id="@+id/RelativeLayout01"
                android:layout_width="wrap_content"
android:layout_height="wrap_content">
                        <ImageView
                                android:id="@+id/ImageView01"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:background="@drawable/quizicon"
                                android:layout_alignParentLeft="true"
                                android:layout_alignParentTop="true">
                        </ImageView>
                        <TextView
                                android:id="@+id/TextView01"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/help"
                                android:layout_alignParentTop="true"
                                android:layout_centerHorizontal="true"
                                android:textSize="@dimen/menuxmlTitleSize"
                                android:textColor="@color/menuxmlTitleColor">
                        </TextView>
                        <ImageView
                                android:id="@+id/ImageView02"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:background="@drawable/quizicon"
                                android:layout_alignParentRight="true"
                                android:layout_alignParentTop="true">
                        </ImageView>

</RelativeLayout>
<TextView
android:text="@+id/TextView02"
android:id="@+id/TextView_HelpText"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>

I had a similar problem which came down to an XML layout issue and I'm
sure it's a similar issue here only I don't know how to resolve it.

Can someone please help and tell me how I can get the TextView to
display and perhaps more importantly, direct me to some good android
xml layout material?

Thanks.

-- 

3. Documentation Building

4. Is animated-rotate available for developers?

5. Get DNS IP address from WLAN and 3G connection

6. Adaptive streaming - any plans for Android implementation?

7. how to fill the irregular shape with the red color?