Sobes.tech
Junior — Senior

Order of calling Activity lifecycle methods during sequential transitions

livecode

Task condition

Three Activities are involved in the scenario. Determine which lifecycle callbacks will be executed for each of them during transitions.

// Activity 1 launches Activity 2

fun onCreate () { // this is Activity 2
    this.finish()
    // open Activity 3
}

Expected result

  • for Activity 1: onPause, onStop
  • for Activity 2: onDestroy
  • for Activity 3: all methods up to and including onResume