pause

fun pause()

The layout must be removed from the windowManager before the activity is destroyed, or the window will be leaked. Therefore we add/remove the ownerView in resume/pause.