Code example for Instrumentation

Methods: runOnMainSync

     * @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() {
            public void run() { 
     * 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.