public void finishOpenedActivities ( ) { // Stops the activityStack listener activitySyncTimer . cancel ( ) ; if ( ! config . trackActivities ) { useGoBack ( 3 ) ; return ; } ArrayList < Activity > activitiesOpened = getAllOpenedActivities ( ) ; // Finish all opened activities for ( int i = activitiesOpened . size ( ) - 1 ; i >= 0 ; i -- ) { sleeper . sleep ( MINISLEEP ) ; finishActivity ( activitiesOpened . get ( i ) ) ; } activitiesOpened = null ; sleeper . sleep ( MINISLEEP ) ; // Finish the initial activity, pressing Back for good measure finishActivity ( getCurrentActivity ( true , false ) ) ; stopActivityMonitor ( ) ; setRegisterActivities ( false ) ; this . activity = null ; sleeper . sleepMini ( ) ; useGoBack ( 1 ) ; clearActivityStack ( ) ; }
All activites that have been opened are finished .