As Mark said, the solution is add your onKey inside the dialog.
Or create a custom dialog instead using Dialog. See below:
public class CustomDialog extends Dialog
{
public CustomDialog(Context context) {
super(context);
setOnKeyListener(new MyOnKeyListener());
}
class MyOnKeyListener implements
android.content.DialogInterface.OnKeyListener
{
@Override
public boolean onKey(DialogInterface dialog, int keyCode,
KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_SEARCH)
{
System.out.println("----- ignore search
pressed");
return true;
}
return false;
}
}
}
--
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