Code example for Instrumentation

Methods: getTargetContextstartActivitySync

0
	} 
 
	protected void launchMainActivity() { 
		final Intent intent = new Intent(Intent.ACTION_MAIN);
		intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent.setClassName(instrumentation.getTargetContext(), SalesforceSDKManager.getInstance().getMainActivityClass().getName());
		mainActivity = instrumentation.startActivitySync(intent);
	} 
 
	protected Event waitForEvent(EventType type) {
		Log.i("ForceAppInstrumentationTestCase.waitForEvent", "Waiting for " + type);
		Event evt = eq.waitForEvent(type, getWaitTimeout());
		 
    	if (type == EventType.AuthWebViewPageFinished || type == EventType.GapWebViewPageFinished) {
    		waitSome(); 
    		// When page finished is fired, DOM is not ready :-( 
    	} 
		Log.i("ForceAppInstrumentationTestCase.waitForEvent", "Got " + evt.getType());
    	return evt;
    }