tags:

views:

25

answers:

1

I would like to be able to detect when a user types a key in the Search Dialog. I plan on using this to hook in to custom suggestion functionality.

Note: The built-in Search Manager custom suggestions functionality won't work for me because I need to customize the layout of the suggestions.

A: 

No, sorry, the global search dialog is not extensible by your code.

CommonsWare
I'm not referring to the global search dialog. I'm referring to the SearchDialog I've instantiated in my own Activity by registering the Intent Filter android.intent.action.SEARCH.
m2green
For example, Can I get a reference to that SearchDialog (or its' parent) so I can set the Event Listener?
m2green
@m2green: If it is your own search activity, then you can do whatever you want. If it is the system search dialog, I know of no way for you to access it -- I'm not even sure it is executing in your process.
CommonsWare
I just ended up avoiding the SearchDialog altogether. It was easy enough to create my own search UI, the the benefit of much more flexibility.
m2green
I guess the SearchDialog is really useful for simple search and/or if you want to expose your App Search to the Global Search.
m2green
@m2green: Agreed. If you want to do anything more than simple keyword search of your own app, you're better served rolling your own UI for it, whether as a separate activity or dialog or whatever.
CommonsWare