added onPause and onResume

pausing the sensor when exiting the app