5

I have an password dialog which is called every-time when onResume() of Activity is called.

But this dialog sometimes never responds to click or touch events gives warnings as below :

Cancelling event due to no window focus: MotionEvent { action=ACTION_CANCEL, actionButton=0, id[0]=0, x[0]=712.2646, y[0]=484.42004, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, ed

 Dropping event due to no window focus: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=703.39716, y[0]=503.06372, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, f

The dialog box is shown if its not already shown & also I am requesting focus as well on window root view as follows :

if (pinDialog != null && pinDialog.isShowing()) {
            dialogRootView.requestFocus();
            editBox.requestFocus();
            return;
        }

I have an onTouch listener implemented on EditBox to request the keyboard to be shown as follows :

@Override
            public boolean onTouch(View v, MotionEvent event) {
                if (event.getAction() == MotionEvent.ACTION_UP) {
                    EditText et = (EditText) v;
                    et.getText().clear();
                    et.requestFocus();
                    return false;
                }
                return false;
            }

This warning can be ignored as stated here.

But then what may be the reason of not responding Dialog and giving those warnings about window no focus ?

Prashant
  • 4,474
  • 8
  • 34
  • 82

0 Answers0