views:

300

answers:

1

I have a ListActivity based on an ArrayAdapter with setTextFilterEnabled set to true. This works fine on a device with a physical keyboard. When I start typing something on the keyboard, the items get filtered.

My question is how to get the same behavior on a device with no physical keyboard?

+2  A: 

The user needs to long-tap the MENU button to bring up the soft keyboard. Then, AFAIK, filtering works as normal.

Note that I don't do much ListView filtering, so I'm basing this on my recollection of past discussions of this issue.

CommonsWare
Nope. Menu doesn't bring up the keyboard (g1, portrait).
alex
You will note that the G1 has a physical keyboard. On the Nexus One, long-tap of MENU brings up the soft keyboard.
CommonsWare
I see. Thought this wouldn't matter with keyboard hidden.
alex
I would have thought so too, but apparently not -- I tried my G1 as well and got the same behavior. It's possible it is an Android 2.x feature, but I thought it existed before then. My memory gets fuzzy...
CommonsWare
So I guess, in order to be sure that the user can search on all devices I should also hook into the user pressing the Search button.
Erdal
After some testing on a few devices it looks like on devices with physical keyboard, long pressing on the menu button doesn't bring up the virtual keyboard. You have to slide the keyboard and start typing to get filtering. On devices without a virtual keyboard long pressing on menu does the trick.
Erdal