1

Within my application, I would like to intercept when the search button is pressed, and display a fragment that provides the search functionality in our application.

I have attempted to override the Activity.onKeyDown, Activity.dispatchKeyEvent, Activity.onKeyUp Activity.onSearchRequested, and setting the appropriate listeners on all the views within the activity.

However, none of these methods are ever called when the search button is pressed, and the standard GoogleTV search box is displayed.

What is the correct way to intercept the search button?

Thanks

Steve
  • 53,375
  • 33
  • 96
  • 141

2 Answers2

2

Unfortunately, for Google TV, you can't intercept the Search Key. User testing said this was a problem, so Search is always global. You should have a Search Icon on your layout somewhere.

0

Can't help wondering if your users were tested with apps that have Search icons elsewhere in their layout, per your suggestion. :-/ It's not a happy user experience, trust me. Neither is the current scheme for search in the default Google TV music player.

How many users were tested, and what are the prospects of retesting them?

Robin Davies
  • 7,547
  • 1
  • 35
  • 50
  • I'm not sure I understand your point. A user is in our application when they select the icon, and they know this. If I was a user, and pressed the search button within an application that supports some type of search functionality, I would expect that application to respond. – Steve Nov 27 '12 at 12:08
  • Absolutely agreed. But that's not what happens Google TV. The Search button invokes the global search, instead of the application search. UNLIKE stock android, the search key is not interceptable on Google TV. I tripped over this using Play on Google TV yesterday: you ddad-dpad-dpad to get to the search icon, because the search button doesn't invoke Google Play search. Hoping the google developers will reconsider. – Robin Davies Dec 02 '12 at 08:55