Try using 
onSearchRequested<http://developer.android.com/reference/android/view/Window.Callback.html#onSearchRequested()>
().

Varun

On Sat, Dec 11, 2010 at 11:30 PM, Mark Murphy <[email protected]>wrote:

> Put that in your Dialog subclass, then.
>
> On Sat, Dec 11, 2010 at 12:57 PM, acr <[email protected]> wrote:
> > To add to my original post.. I do have the following (which DOES
> > prevent the search key from being pressed) in the activity it just
> > doesn't work when the dialog is open.
> >
> > ....
> > if (keyCode == KeyEvent.KEYCODE_SEARCH) {
> >                        System.out.println("search pressed");
> >            return true;
> >        }
> >        ....
> >
> >
> >
> > On Dec 11, 12:49 pm, acr <[email protected]> wrote:
> >> Hi,
> >> Anyone know of a way to prevent the search key from canceling an alert
> >> dialog? I have alert.setCancelable(false); and it works fine for the
> >> back button, but when i hit the search key it goes to search.. and
> >> when I close the search my NON-Cancelable dialog is gone. any way to
> >> fix this. Please help
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
> >
>
>
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Training in London: http://bit.ly/smand1 and http://bit.ly/smand2
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to