-Added override for onPause() and onResume() functions