Share via


Activity.OnUserInteraction Method

Definition

Called whenever a key, touch, or trackball event is dispatched to the activity.

[Android.Runtime.Register("onUserInteraction", "()V", "GetOnUserInteractionHandler")]
public virtual void OnUserInteraction ();
[<Android.Runtime.Register("onUserInteraction", "()V", "GetOnUserInteractionHandler")>]
abstract member OnUserInteraction : unit -> unit
override this.OnUserInteraction : unit -> unit
Attributes

Remarks

Called whenever a key, touch, or trackball event is dispatched to the activity. Implement this method if you wish to know that the user has interacted with the device in some way while your activity is running. This callback and #onUserLeaveHint are intended to help activities manage status bar notifications intelligently; specifically, for helping activities determine the proper time to cancel a notification.

All calls to your activity's #onUserLeaveHint callback will be accompanied by calls to #onUserInteraction. This ensures that your activity will be told of relevant user activity such as pulling down the notification pane and touching an item there.

Note that this callback will be invoked for the touch down action that begins a touch gesture, but may not be invoked for the touch-moved and touch-up actions that follow.

Java documentation for android.app.Activity.onUserInteraction().

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