Code example for Instrumentation

Methods: startActivitySync

0
                                   getInstrumentation().getTargetContext(),
                                   ViewImage.class); 
 
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
        mActivity = (ViewImage) mInstrumentation.startActivitySync(intent);
        Log.d(TAG,TAG2+":setUp:ViewImage launched");
    } 
     
    @Override 
    protected void tearDown() throws Exception { 
        if (mActivity != null) {
            mActivity.finish();
            mActivity = null;
            Log.v(TAG,TAG2+":tearDown:ViewImage finished");
        } 
        super.tearDown(); 
    } 
 
    private void sleepFor(long time) {
        Log.v(TAG,TAG2+":sleepFor "+time+" ms");