Code example for Button

Methods: requestFocus

0
         
        // Push button 
        // Bring the target EditText into focus. 
        mTargetActivity.runOnUiThread(new Runnable() {
            public void run() { 
                button.requestFocus();
            } 
        }); 
         
        sendKeys(KeyEvent.KEYCODE_DPAD_CENTER);
         
        // Give it a couple seconds 
        pause(2000); 
         
        // We should have initialized imm.mServedView and imm.mCurrentTextBoxAttribute 
        assertTrue(mImm.isActive()); 
        // imm.mServedInputConnection should be null since Button doesn't override onCreateInputConnection(). 
        assertFalse(mImm.isAcceptingText()); 
         
        destructiveCheckImeInitialState(mTargetActivity.getRootView(), button);