Fixed onResume/onPause error.