Code example for Button

Methods: requestFocus

    // Test that a posted requestFocus works. 
    public void testPostedRequestFocus() throws Exception { Runnable() { public void run() {
        synchronized(this) {
            try { 
            } catch (InterruptedException e) {
                // Don't care. 
        assertTrue("Focus should move to bottom left", mBottomLeftButton.hasFocus());
    // Test that a requestFocus from the wrong thread fails. 
    public void testWrongThreadRequestFocusFails() throws Exception { 
Stop searching for code, let great code find you!  Add Codota to your java IDE