Code example for ImageButton

Methods: performClick

0
        final ImageButton imageButton = (ImageButton) 
		solo.getView(com.example.zootypers.R.id.panda_button);
        getActivity().runOnUiThread(new Runnable() {
            @Override 
            public void run() { 
                imageButton.performClick();
            } 
        }); 
        solo.sleep(1000);
        View expected = solo.getView(com.example.zootypers.R.id.panda_button);
        View actual = getActivity().getAnimalView();
        assertEquals(expected, actual);
    } 
 
    /** 
     * Tests to see if Grassland terrain can be pushed and saves the correct view. 
     */ 
    @Test(timeout = TIMEOUT) 
    public void testSelectingGrasslandBackground() { 
        final ImageButton imageButton = (ImageButton) 
		solo.getView(com.example.zootypers.R.id.BG1_button);