Code example for Instrumentation

Methods: callActivityOnPause

0
    } 
 
    public static void callOnPauseOnUiThread(final Activity a, final Instrumentation instr) {
        a.runOnUiThread(new Runnable() {
            public void run() { 
                instr.callActivityOnPause(a);
            } 
        }); 
    } 
 
    public static void callOnResumeOnUiThread(final Activity a, final Instrumentation instr) {
        a.runOnUiThread(new Runnable() {
            public void run() { 
                instr.callActivityOnResume(a);
            } 
        }); 
    } 
 
    public static void sleep(int ms) {
        try { 
            Thread.sleep(ms);