Code example for Instrumentation

Methods: runOnMainSync

0
     * 
     * @param instrumentation Instrumentation object used by the test. 
     * @param v The view to call performClick on. 
     */ 
    public static void performClickOnMainSync(Instrumentation instrumentation, final View v) {
        instrumentation.runOnMainSync(new Runnable() {
            @Override 
            public void run() { 
                v.performClick();
            } 
        }); 
    } 
 
    /** 
     * Clicks on specified view in the given {@link Activity}. 
     * 
     * @param test The test case using this utility. 
     * @param activity Activity containing the view. 
     * @param id The view to be clicked. 
     * @return {@code true} if a view with the given id exists. 
     */