Code example for Instrumentation

Methods: startActivitySync

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