Added onResume and onPause commands for the App Activity Life Cycle