/** Is called when the application is paused */ @Override public void onPause() { super.onPause(); locationListener.stopLocationUpdate(); // Pauses the lcoation listener getWindow() .clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // Disable screen lock on if (isAlive) { frequencyListener.pause(); sensorDataObservable.Pause(); // Pauses the sensor observer } }