Search in sources :

Example 16 with SensorEventListener

use of android.hardware.SensorEventListener in project xDrip-plus by jamorham.

the class Reminders method onPause.

@Override
protected void onPause() {
    super.onPause();
    Log.d(TAG, "onPause");
    final SensorEventListener activity = this;
    JoH.runOnUiThreadDelayed(new Runnable() {

        @Override
        public void run() {
            Log.d(TAG, "Unregistering proximity sensor listener");
            try {
                mSensorManager.unregisterListener(activity);
            } catch (Exception e) {
                Log.d(TAG, "Error unregistering proximity listener: " + e);
            }
        }
    }, 10000);
}
Also used : SensorEventListener(android.hardware.SensorEventListener)

Aggregations

SensorEventListener (android.hardware.SensorEventListener)16 Sensor (android.hardware.Sensor)10 SensorEvent (android.hardware.SensorEvent)8 Test (org.junit.Test)5 TextView (android.widget.TextView)3 View (android.view.View)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 SensorManager (android.hardware.SensorManager)1 Message (android.os.Message)1 ViewGroup (android.view.ViewGroup)1 CircularProgressView (com.github.rahatarmanahmed.cpv.CircularProgressView)1