Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have clicking the phone's search button do nothing?

Tags:

android

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?

like image 582
charlest Avatar asked Mar 07 '11 03:03

charlest


1 Answers

Override the onSearchRequested method of Activity class:

public boolean onSearchRequested() {

        // Do whatever you want here.


        return true;
}
like image 115
Mudassir Avatar answered Nov 07 '22 15:11

Mudassir