private final void waitForActivityIfNotAvailable(){
		if(activityStack.isEmpty() || activityStack.peek().get() == null){

			if (activityMonitor != null) {
				Activity activity = activityMonitor.getLastActivity();
				while (activity == null){
					sleeper.sleepMini();
					activity = activityMonitor.getLastActivity();
				}
				addActivityToStack(activity);
			}
			else if(config.trackActivities){
				sleeper.sleepMini();
				setupActivityMonitor();
				waitForActivityIfNotAvailable();
			}
		}
	}
private final void waitForActivityIfNotAvailable ( ) { if ( activityStack . isEmpty ( ) || activityStack . peek ( ) . get ( ) == null ) { if ( activityMonitor != null ) { Activity activity = activityMonitor . getLastActivity ( ) ; while ( activity == null ) { sleeper . sleepMini ( ) ; activity = activityMonitor . getLastActivity ( ) ; } addActivityToStack ( activity ) ; } else if ( config . trackActivities ) { sleeper . sleepMini ( ) ; setupActivityMonitor ( ) ; waitForActivityIfNotAvailable ( ) ; } } }
Waits for an activity to be started if one is not provided
by the constructor.