This do not work too.

dialog = new ProgressDialog(Main.this){
       @Override
        public boolean onSearchRequested() {
                return false;
        }
};


On Sunday, 24 June 2012 00:16:40 UTC+8, Mystique wrote:
>
> I have a simple ProgressDialog but I realized if I press the search button 
> the dialog will be dismiss. What can I do to disable search button press 
> during this process? 
>
> dialog = new ProgressDialog(Main.this);
> dialog.setTitle("Working in progress");
> dialog.setMessage("Please wait...");
> dialog.setCancelable(false);
> dialog.show();
>
> I add a setOnKeyListener but it is still now working.
>
>     dialog.setOnKeyListener(new DialogInterface.OnKeyListener() {
>         public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent 
> event) {
>             if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() 
> == 0) {
>                 return true; // Pretend we processed it
>             }
>             return false; // Any other keys are still processed as normal
>         }
>     }); 
>
>

-- 
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