I'm trying to set up a screen so that when you click on the magnifying glass at the bottom of the phone it doesn't show the standard search area at the top of the screen: essentially, have it ignore (or catch it so I can do nothing) when the magnifying class is clicked on?
Asked
Active
Viewed 780 times
1 Answers
5
Override the onSearchRequested method of Activity class:
public boolean onSearchRequested() {
// Do whatever you want here.
return true;
}

Mudassir
- 13,031
- 8
- 59
- 87
-
@charlest: If my answer solved your problem, please mark it as accepted by clicking on the small check mark left of it. – Mudassir Mar 08 '11 at 03:08
-
@NomanArain: Which version (and device) you are trying it on? – Mudassir Nov 01 '12 at 02:32
-
Android Version: 2.3.3, Sprint L5670 Optimus – Noman Arain Nov 01 '12 at 14:46
-
I've tested it till Version 2.2. I don't have a 2.3 device with Search button for testing. – Mudassir Nov 02 '12 at 02:30