Invoking a search or filter on an Android ListFragment?

I’m using the Android compatibility library, and I’m using a ListFragment. I have it set up to display the items in my list quite nicely. However, now I want to give the users the ability to filter/search the data. How do I set this up? Is it any different then it was with the regular ListView? And if so, do I place all my code for that in the ListFragment, or the parent Activity?

  • Android - ImageView overlay another ImageView
  • How to delete tables and database using Sqiltehelper in android
  • Facing Orientation issue with Camera captured image on Android phones
  • Loading a URL inside a TXT in a Webview
  • Android : Providing auto autosuggestion in android places Api?
  • Bluetooth : Transfering call from Source Android phone to sink-audio development kit?
  • Related posts:

    What is a “bundle” in an Android application
    Android button font size
    Maintain Scroll Position of GridView through Screen Rotation
    Android ListView Text Color
    How to create an admob banner programmatically?
    How do you display a 2 digit NumberPicker in android?
  • Phone: numeric keyboard for text input
  • How to fix The method startActivity(Intent) is undefined for the type new View.OnClickListener() syntax error
  • Set a menu item as checked from code
  • Get string from default locale using string in specific locale
  • Robolectric RoboAttributeSet - How to use this
  • what are the design patterns used in android?
  • One Solution collect form web for “Invoking a search or filter on an Android ListFragment?”

    You need to have your Adapter implement Filterable interface, then override getFilter() method. Actually ArrayAdapter offers a simple Filtrable implementation, you can check out the ArrayAdapter source code to find out how it works.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.