Code example for View

Methods: hasFocus, requestFocus

0
        assertTrue(root.hasFocus());
    } 
 
    @Test 
    public void clearFocus_shouldRecursivelyClearTheFocusOfAllChildren() throws Exception { 
        child3a.requestFocus();
 
        root.clearFocus();
 
        assertFalse(child3a.hasFocus());
        assertFalse(child3.hasFocus());
        assertFalse(root.hasFocus());
 
        root.requestFocus();
        root.clearFocus();
        assertFalse(root.hasFocus());
    } 
 
    @Test 
    public void dump_shouldDumpStructure() throws Exception { 
        child3.setId(R.id.snippet_text);