SensorManager.CancelTriggerSensor(TriggerEventListener, Sensor) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Cancels receiving trigger events for a trigger sensor.
[Android.Runtime.Register("cancelTriggerSensor", "(Landroid/hardware/TriggerEventListener;Landroid/hardware/Sensor;)Z", "GetCancelTriggerSensor_Landroid_hardware_TriggerEventListener_Landroid_hardware_Sensor_Handler")]
public virtual bool CancelTriggerSensor (Android.Hardware.TriggerEventListener? listener, Android.Hardware.Sensor? sensor);
[<Android.Runtime.Register("cancelTriggerSensor", "(Landroid/hardware/TriggerEventListener;Landroid/hardware/Sensor;)Z", "GetCancelTriggerSensor_Landroid_hardware_TriggerEventListener_Landroid_hardware_Sensor_Handler")>]
abstract member CancelTriggerSensor : Android.Hardware.TriggerEventListener * Android.Hardware.Sensor -> bool
override this.CancelTriggerSensor : Android.Hardware.TriggerEventListener * Android.Hardware.Sensor -> bool
Parameters
- listener
- TriggerEventListener
The listener on which the
TriggerEventListener#onTrigger(TriggerEvent)
is delivered.It should be the same as the one used
in #requestTriggerSensor(TriggerEventListener, Sensor)
- sensor
- Sensor
The sensor for which the trigger request should be canceled. If null, it cancels receiving trigger for all sensors associated with the listener.
Returns
true if successfully canceled.
- Attributes
Exceptions
when sensor is a trigger sensor.
Remarks
Cancels receiving trigger events for a trigger sensor.
Note that a Trigger sensor will be auto disabled if TriggerEventListener#onTrigger(TriggerEvent)
has triggered. This method is provided in case the user wants to explicitly cancel the request to receive trigger events.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.