SensorManager.Flush(ISensorEventListener) Method

Definition

Flushes the FIFO of all the sensors registered for this listener.

[Android.Runtime.Register("flush", "(Landroid/hardware/SensorEventListener;)Z", "GetFlush_Landroid_hardware_SensorEventListener_Handler")]
public virtual bool Flush (Android.Hardware.ISensorEventListener? listener);
[<Android.Runtime.Register("flush", "(Landroid/hardware/SensorEventListener;)Z", "GetFlush_Landroid_hardware_SensorEventListener_Handler")>]
abstract member Flush : Android.Hardware.ISensorEventListener -> bool
override this.Flush : Android.Hardware.ISensorEventListener -> bool

Parameters

listener
ISensorEventListener

A android.hardware.SensorEventListener SensorEventListener object which was previously used in a registerListener call.

Returns

true if the flush is initiated successfully on all the sensors registered for this listener, false if no sensor is previously registered for this listener or flush on one of the sensors fails.

Attributes

Exceptions

when listener is null.

Remarks

Flushes the FIFO of all the sensors registered for this listener. If there are events in the FIFO of the sensor, they are returned as if the maxReportLantecy of the FIFO has expired. Events are returned in the usual way through the SensorEventListener. This call doesn't affect the maxReportLantecy for this sensor. This call is asynchronous and returns immediately. android.hardware.SensorEventListener2#onFlushCompleted onFlushCompleted is called after all the events in the batch at the time of calling this method have been delivered successfully. If the hardware doesn't support flush, it still returns true and a trivial flush complete event is sent after the current event for all the clients registered for this sensor.

Java documentation for android.hardware.SensorManager.flush(android.hardware.SensorEventListener).

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.

Applies to

See also

  • <xref:Android.Hardware.SensorManager.RegisterListener(Android.Hardware.ISensorEventListener%2c+Android.Hardware.Sensor%2c+Android.Hardware.Sensor%2c+Android.Hardware.Sensor)>