prepare to implement onPause() and onResume()