Added onResume() and onPause() to MainActivity