Code example for Instrumentation

Methods: callActivityOnPausecallActivityOnResume

		Instrumentation mInstr = this.getInstrumentation();
		// Use instrumentation to call the Activity's onPause() 
		/* Under test, the activity is waiting for input. The invocation of 
		 * callActivityOnPause( performs a call directly to the activity's onPause() 
		 * instead of manipulating the activity's UI to force it into a paused state. */ 
		// Test if location were disabled 
		/* This ensures that resuming the activity actually restores the location manager rather than simply 
		 * leaving it as it was. */ 
		// Use instrumentation to call the Activity's onResume(): 
		/* Invoking callActivityOnResume( affects the activity in a way similar to 
		 * callActivityOnPause. The activity's onResume() method is invoked instead of manipulating the 
		 * activity's UI to force it to resume. */