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. Drawable.createFromStream() and OutOfMemoryError exception

Hi,

Would you please help me how to handle the memory leak on
Drawable.createFromStream()?

 I am receiving a base64 image from a webservice. And I decode it using
Apache lib. After that I convert it to drawable through
Drawable.createFromStream(). But when the image size is bit larger (~>350kb)
it starts throwing OutOfMemoryError exception. Ok, I can handle this by
catching this exception. But eventually after catching 2 or 3 such
exceptions the heap is full and it start throwing exceptions for other
methods and for small images as well.

The relevant code snip is given below.


        byte[] arr = null;
        InputStream imageStream = null;
        try
        {
            arr = Base64.decodeBase64(result.getScreenShot().getBytes());

            imageStream = new BufferedInputStream(new
ByteArrayInputStream(arr));
            TJCAppDetail.this.screenShotDrawable =
Drawable.createFromStream(imageStream, "src");
            screenShot.setImageDrawable(screenShotDrawable);
        }
        catch (OutOfMemoryError outOfMemoryError)
        {
            arr = null;
            imageStream = null;
            if (screenShotDrawable != null)
            {
            screenShotDrawable.setCallback(null);
            if (((BitmapDrawable) screenShotDrawable).getBitmap() != null)
                ((BitmapDrawable) screenShotDrawable).getBitmap().recycle();
            }

            Log.e("TJC_EXCEPTION", outOfMemoryError.getMessage());
        }



--
Best Regards,
Atif Gulzar

I  Unicode, zln 

-- 

2. High number of Charge backs?

Have any application developers gotten charge backs over the past few
days from google checkout?  I have 6 apps in the market that are rated
at least 4/5, and have never had a charge back before, but over the
past two days I have had 5!  That means $15 came out of my pocket the
past 2 days!  I have been selling apps since February and never had a
charge back, and all of a sudden I have had 5.  Just wondering if I am
alone in this situation.

Thanks,
Chuck

-- 

3. Read Phone Contact in Vcard Format in Android or retrieve All the contacts values2.0

4. Every time one new instance instance is not created for standard launch mode activity???

5. Handling back button with Soft keypad

6. help : adb devices doesnot work

7. disable GPS