Beispiel #1
0
 @Override
 public void onPause(Activity activity) {
   super.onPause(activity);
   if (significantMotionEnabled && significantMotionRegistered) {
     sensorManager.cancelTriggerSensor(mTriggerEventListener, mSensor);
   }
 }
 public void testCancelTriggerWithNonTriggerSensor() {
   Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
   boolean result;
   if (sensor != null) {
     result = mSensorManager.cancelTriggerSensor(mTriggerListener, sensor);
     assertFalse(result);
   }
 }