1

What is the purpose of onSearchRequested()? I am referring to here: http://developer.android.com/reference/android/app/Activity.html#onSearchRequested%28%29

The following is stated: "You can override this function to force global search, e.g. in response to a dedicated search key, or to block search entirely (by simply returning false)." Specifically, what does the bolded piece mean? Does it not mean that we are able to disable this button? I just had a heated discussion at: Android - How to disable Search button, how to implement onSearchRequested()?

As you can see, Phil is suggesting that I have to go the other route. My questions are: can JUST this function be used to disable the search button completely? Can just this function be used without having to disable this button from the dialog builder? What did google meant with the above quoted statement? Thank you for your time.

Community
  • 1
  • 1
Noman Arain
  • 1,172
  • 4
  • 19
  • 45

1 Answers1

1

You should be able to disable the search button using it, i would think google mean that you can block someone trying to search from within your app( IE skipping a progress dialog) but since most android phones don't come with search buttons anymore, its not a very used function.

and yes you should be able to disable it on the fly without going through the dialog builder.

Swift

Excalibur
  • 467
  • 2
  • 7
  • 15
  • I've asked that question. You missed a lot of the questions I've asked up there. – Noman Arain Nov 11 '12 at 20:04
  • All right, cool. "and yes you should be able to disable it on the fly without going through the dialog builder." This is what I really needed to know. My other question seemed to have failed to get me the answer I was looking for. Not sure how to move on a head. – Noman Arain Nov 12 '12 at 15:04