MotionEvent.Obtain 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.
Overloads
Obtain(Int64, Int64, MotionEventActions, Int32, MotionEvent+PointerProperties[], MotionEvent+PointerCoords[], MetaKeyStates, MotionEventButtonState, Single, Single, Int32, Edge, InputSourceType, Int32, MotionEventFlags, ClassificationMode)
Creates a motion event from the supplied pointer data.
[Android.Runtime.Register("obtain", "(JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIIIII)Landroid/view/MotionEvent;", "", ApiSince=34)]
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, Android.Views.MotionEventActions action, int pointerCount, Android.Views.MotionEvent.PointerProperties[] pointerProperties, Android.Views.MotionEvent.PointerCoords[] pointerCoords, Android.Views.MetaKeyStates metaState, Android.Views.MotionEventButtonState buttonState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags, Android.Views.InputSourceType source, int displayId, Android.Views.MotionEventFlags flags, Android.Views.ClassificationMode classification);
[<Android.Runtime.Register("obtain", "(JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIIIII)Landroid/view/MotionEvent;", "", ApiSince=34)>]
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * int * Android.Views.MotionEvent.PointerProperties[] * Android.Views.MotionEvent.PointerCoords[] * Android.Views.MetaKeyStates * Android.Views.MotionEventButtonState * single * single * int * Android.Views.Edge * Android.Views.InputSourceType * int * Android.Views.MotionEventFlags * Android.Views.ClassificationMode -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The System.Int64 value used for down time.
- eventTime
- Int64
The System.Int64 value used for event time.
- action
- MotionEventActions
The Android.Views.MotionEventActions value used for action.
- pointerCount
- Int32
The System.Int32 value used for pointer count.
- pointerProperties
- MotionEvent.PointerProperties[]
The Android.Views.MotionEvent+PointerProperties[] value used for pointer properties.
- pointerCoords
- MotionEvent.PointerCoords[]
The Android.Views.MotionEvent+PointerCoords[] value used for pointer coords.
- metaState
- MetaKeyStates
The Android.Views.MetaKeyStates value used for meta state.
- buttonState
- MotionEventButtonState
The Android.Views.MotionEventButtonState value used for button state.
- xPrecision
- Single
The System.Single value used for x precision.
- yPrecision
- Single
The System.Single value used for y precision.
- deviceId
- Int32
The System.Int32 value used for device id.
- edgeFlags
- Edge
The Android.Views.Edge value used for edge flags.
- source
- InputSourceType
The Android.Views.InputSourceType value used for source.
- displayId
- Int32
The System.Int32 value used for display id.
- flags
- MotionEventFlags
The Android.Views.MotionEventFlags value used for flags.
- classification
- ClassificationMode
The Android.Views.ClassificationMode value used for classification.
Returns
The result of the obtain operation.
- Attributes
Remarks
For details, see the Android reference documentation for android.view.MotionEvent.obtain.
Java documentation for android.view.MotionEvent.obtain.
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
Obtain(Int64, Int64, MotionEventActions, Int32, MotionEvent+PointerProperties[], MotionEvent+PointerCoords[], MetaKeyStates, MotionEventButtonState, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags)
Create a new MotionEvent, filling in all of the basic values that define the motion.
[Android.Runtime.Register("obtain", "(JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent;", "")]
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, Android.Views.MotionEventActions action, int pointerCount, Android.Views.MotionEvent.PointerProperties[]? pointerProperties, Android.Views.MotionEvent.PointerCoords[]? pointerCoords, Android.Views.MetaKeyStates metaState, Android.Views.MotionEventButtonState buttonState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags, Android.Views.InputSourceType source, Android.Views.MotionEventFlags flags);
[<Android.Runtime.Register("obtain", "(JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent;", "")>]
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * int * Android.Views.MotionEvent.PointerProperties[] * Android.Views.MotionEvent.PointerCoords[] * Android.Views.MetaKeyStates * Android.Views.MotionEventButtonState * single * single * int * Android.Views.Edge * Android.Views.InputSourceType * Android.Views.MotionEventFlags -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The time (in ms) when the user originally pressed down to start
a stream of position events. This must be obtained from SystemClock#uptimeMillis().
- eventTime
- Int64
The the time (in ms) when this specific event was generated. This
must be obtained from SystemClock#uptimeMillis().
- action
- MotionEventActions
The kind of action being performed, such as #ACTION_DOWN.
- pointerCount
- Int32
The number of pointers that will be in this event.
- pointerProperties
- MotionEvent.PointerProperties[]
An array of pointerCount values providing a pointer property object for each pointer, which must include the pointer identifier.
- pointerCoords
- MotionEvent.PointerCoords[]
An array of pointerCount values providing a pointer coordinate object for each pointer.
- metaState
- MetaKeyStates
The state of any meta / modifier keys that were in effect when the event was generated.
- buttonState
- MotionEventButtonState
The state of buttons that are pressed.
- xPrecision
- Single
The precision of the X coordinate being reported.
- yPrecision
- Single
The precision of the Y coordinate being reported.
- deviceId
- Int32
The id for the device that this event came from. An id of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.
- edgeFlags
- Edge
A bitfield indicating which edges, if any, were touched by this MotionEvent.
- source
- InputSourceType
The source of this event.
- flags
- MotionEventFlags
The motion event flags.
Returns
The result of the obtain operation.
- Attributes
Remarks
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
Obtain(Int64, Int64, Int32, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)
Creates a motion event from the supplied pointer data.
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, int action, int pointers, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
static member Obtain : int64 * int64 * int * int * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The System.Int64 value used for down time.
- eventTime
- Int64
The System.Int64 value used for event time.
- action
- Int32
The System.Int32 value used for action.
- pointers
- Int32
The System.Int32 value used for pointers.
- x
- Single
The System.Single value used for x.
- y
- Single
The System.Single value used for y.
- pressure
- Single
The System.Single value used for pressure.
- size
- Single
The System.Single value used for size.
- metaState
- MetaKeyStates
The Android.Views.MetaKeyStates value used for meta state.
- xPrecision
- Single
The System.Single value used for x precision.
- yPrecision
- Single
The System.Single value used for y precision.
- deviceId
- Int32
The System.Int32 value used for device id.
- edgeFlags
- Edge
The Android.Views.Edge value used for edge flags.
Returns
The result of the obtain operation.
Remarks
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
Obtain(Int64, Int64, MotionEventActions, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)
Caution
deprecated
Create a new MotionEvent, filling in all of the basic values that define the motion.
[Android.Runtime.Register("obtain", "(JJIIFFFFIFFII)Landroid/view/MotionEvent;", "")]
[System.Obsolete("deprecated")]
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, Android.Views.MotionEventActions action, int pointerCount, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
[<Android.Runtime.Register("obtain", "(JJIIFFFFIFFII)Landroid/view/MotionEvent;", "")>]
[<System.Obsolete("deprecated")>]
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * int * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The time (in ms) when the user originally pressed down to start
a stream of position events. This must be obtained from SystemClock#uptimeMillis().
- eventTime
- Int64
The time (in ms) when this specific event was generated. This
must be obtained from SystemClock#uptimeMillis().
- action
- MotionEventActions
The kind of action being performed, such as #ACTION_DOWN.
- pointerCount
- Int32
The number of pointers that are active in this event.
- x
- Single
The X coordinate of this event.
- y
- Single
The Y coordinate of this event.
- pressure
- Single
The current pressure of this event. The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), however values higher than 1 may be generated depending on the calibration of the input device.
- size
- Single
A scaled value of the approximate size of the area being pressed when touched with the finger. The actual value in pixels corresponding to the finger touch is normalized with a device specific range of values and scaled to a value between 0 and 1.
- metaState
- MetaKeyStates
The state of any meta / modifier keys that were in effect when the event was generated.
- xPrecision
- Single
The precision of the X coordinate being reported.
- yPrecision
- Single
The precision of the Y coordinate being reported.
- deviceId
- Int32
The ID for the device that this event came from. An ID of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.
- edgeFlags
- Edge
A bitfield indicating which edges, if any, were touched by this MotionEvent.
Returns
The result of the obtain operation.
- Attributes
Remarks
Create a new MotionEvent, filling in all of the basic values that define the motion.
This member is deprecated. Use #obtain(long, long, int, float, float, float, float, int, float, float, int, int) instead.
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
Obtain(Int64, Int64, MotionEventActions, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags)
Caution
deprecated
Create a new MotionEvent, filling in all of the basic values that define the motion.
[Android.Runtime.Register("obtain", "(JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent;", "")]
[System.Obsolete("deprecated")]
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, Android.Views.MotionEventActions action, int pointerCount, int[]? pointerIds, Android.Views.MotionEvent.PointerCoords[]? pointerCoords, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags, Android.Views.InputSourceType source, Android.Views.MotionEventFlags flags);
[<Android.Runtime.Register("obtain", "(JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent;", "")>]
[<System.Obsolete("deprecated")>]
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * int * int[] * Android.Views.MotionEvent.PointerCoords[] * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge * Android.Views.InputSourceType * Android.Views.MotionEventFlags -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The time (in ms) when the user originally pressed down to start
a stream of position events. This must be obtained from SystemClock#uptimeMillis().
- eventTime
- Int64
The the time (in ms) when this specific event was generated. This
must be obtained from SystemClock#uptimeMillis().
- action
- MotionEventActions
The kind of action being performed, such as #ACTION_DOWN.
- pointerCount
- Int32
The number of pointers that will be in this event.
- pointerIds
- Int32[]
An array of pointerCount values providing an identifier for each pointer.
- pointerCoords
- MotionEvent.PointerCoords[]
An array of pointerCount values providing a pointer coordinate object for each pointer.
- metaState
- MetaKeyStates
The state of any meta / modifier keys that were in effect when the event was generated.
- xPrecision
- Single
The precision of the X coordinate being reported.
- yPrecision
- Single
The precision of the Y coordinate being reported.
- deviceId
- Int32
The id for the device that this event came from. An id of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.
- edgeFlags
- Edge
A bitfield indicating which edges, if any, were touched by this MotionEvent.
- source
- InputSourceType
The source of this event.
- flags
- MotionEventFlags
The motion event flags.
Returns
The result of the obtain operation.
- Attributes
Remarks
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
Obtain(Int64, Int64, Int32, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, Int32, Int32)
Creates a motion event from the supplied pointer data.
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, int action, int pointers, int[] pointerIds, Android.Views.MotionEvent.PointerCoords[] pointerCoords, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags, int source, int flags);
static member Obtain : int64 * int64 * int * int * int[] * Android.Views.MotionEvent.PointerCoords[] * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge * int * int -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The System.Int64 value used for down time.
- eventTime
- Int64
The System.Int64 value used for event time.
- action
- Int32
The System.Int32 value used for action.
- pointers
- Int32
The System.Int32 value used for pointers.
- pointerIds
- Int32[]
The System.Int32[] value used for pointer ids.
- pointerCoords
- MotionEvent.PointerCoords[]
The Android.Views.MotionEvent+PointerCoords[] value used for pointer coords.
- metaState
- MetaKeyStates
The Android.Views.MetaKeyStates value used for meta state.
- xPrecision
- Single
The System.Single value used for x precision.
- yPrecision
- Single
The System.Single value used for y precision.
- deviceId
- Int32
The System.Int32 value used for device id.
- edgeFlags
- Edge
The Android.Views.Edge value used for edge flags.
- source
- Int32
The System.Int32 value used for source.
- flags
- Int32
The System.Int32 value used for flags.
Returns
The result of the obtain operation.
Remarks
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
Obtain(Int64, Int64, MotionEventActions, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)
Create a new MotionEvent, filling in all of the basic values that define the motion.
[Android.Runtime.Register("obtain", "(JJIFFFFIFFII)Landroid/view/MotionEvent;", "")]
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, Android.Views.MotionEventActions action, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
[<Android.Runtime.Register("obtain", "(JJIFFFFIFFII)Landroid/view/MotionEvent;", "")>]
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The time (in ms) when the user originally pressed down to start
a stream of position events. This must be obtained from SystemClock#uptimeMillis().
- eventTime
- Int64
The time (in ms) when this specific event was generated. This
must be obtained from SystemClock#uptimeMillis().
- action
- MotionEventActions
The kind of action being performed, such as #ACTION_DOWN.
- x
- Single
The X coordinate of this event.
- y
- Single
The Y coordinate of this event.
- pressure
- Single
The current pressure of this event. The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), however values higher than 1 may be generated depending on the calibration of the input device.
- size
- Single
A scaled value of the approximate size of the area being pressed when touched with the finger. The actual value in pixels corresponding to the finger touch is normalized with a device specific range of values and scaled to a value between 0 and 1.
- metaState
- MetaKeyStates
The state of any meta / modifier keys that were in effect when the event was generated.
- xPrecision
- Single
The precision of the X coordinate being reported.
- yPrecision
- Single
The precision of the Y coordinate being reported.
- deviceId
- Int32
The ID for the device that this event came from. An ID of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.
- edgeFlags
- Edge
A bitfield indicating which edges, if any, were touched by this MotionEvent.
Returns
The result of the obtain operation.
- Attributes
Remarks
Create a new MotionEvent, filling in all of the basic values that define the motion.
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
Obtain(Int64, Int64, Int32, Single, Single, MetaKeyStates)
Creates a motion event from the supplied pointer data.
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, int action, float x, float y, Android.Views.MetaKeyStates metaState);
static member Obtain : int64 * int64 * int * single * single * Android.Views.MetaKeyStates -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The System.Int64 value used for down time.
- eventTime
- Int64
The System.Int64 value used for event time.
- action
- Int32
The System.Int32 value used for action.
- x
- Single
The System.Single value used for x.
- y
- Single
The System.Single value used for y.
- metaState
- MetaKeyStates
The Android.Views.MetaKeyStates value used for meta state.
Returns
The result of the obtain operation.
Remarks
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
Obtain(Int64, Int64, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)
Creates a motion event from the supplied pointer data.
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, int action, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
static member Obtain : int64 * int64 * int * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The System.Int64 value used for down time.
- eventTime
- Int64
The System.Int64 value used for event time.
- action
- Int32
The System.Int32 value used for action.
- x
- Single
The System.Single value used for x.
- y
- Single
The System.Single value used for y.
- pressure
- Single
The System.Single value used for pressure.
- size
- Single
The System.Single value used for size.
- metaState
- MetaKeyStates
The Android.Views.MetaKeyStates value used for meta state.
- xPrecision
- Single
The System.Single value used for x precision.
- yPrecision
- Single
The System.Single value used for y precision.
- deviceId
- Int32
The System.Int32 value used for device id.
- edgeFlags
- Edge
The Android.Views.Edge value used for edge flags.
Returns
The result of the obtain operation.
Remarks
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
Obtain(Int64, Int64, MotionEventActions, Single, Single, MetaKeyStates)
Create a new MotionEvent, filling in a subset of the basic motion values.
[Android.Runtime.Register("obtain", "(JJIFFI)Landroid/view/MotionEvent;", "")]
public static Android.Views.MotionEvent? Obtain(long downTime, long eventTime, Android.Views.MotionEventActions action, float x, float y, Android.Views.MetaKeyStates metaState);
[<Android.Runtime.Register("obtain", "(JJIFFI)Landroid/view/MotionEvent;", "")>]
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * single * single * Android.Views.MetaKeyStates -> Android.Views.MotionEvent
Parameters
- downTime
- Int64
The time (in ms) when the user originally pressed down to start
a stream of position events. This must be obtained from SystemClock#uptimeMillis().
- eventTime
- Int64
The time (in ms) when this specific event was generated. This
must be obtained from SystemClock#uptimeMillis().
- action
- MotionEventActions
The kind of action being performed, such as #ACTION_DOWN.
- x
- Single
The X coordinate of this event.
- y
- Single
The Y coordinate of this event.
- metaState
- MetaKeyStates
The state of any meta / modifier keys that were in effect when the event was generated.
Returns
The result of the obtain operation.
- Attributes
Remarks
Create a new MotionEvent, filling in a subset of the basic motion values. Those not specified here are: device id (always 0), pressure and size (always 1), x and y precision (always 1), and edgeFlags (always 0).
Java documentation for android.view.MotionEvent.obtain(long, long, int, float, float, int).
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
Obtain(MotionEvent)
Create a new MotionEvent, copying from an existing one.
[Android.Runtime.Register("obtain", "(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;", "")]
public static Android.Views.MotionEvent? Obtain(Android.Views.MotionEvent? other);
[<Android.Runtime.Register("obtain", "(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;", "")>]
static member Obtain : Android.Views.MotionEvent -> Android.Views.MotionEvent
Parameters
- other
- MotionEvent
The Android.Views.MotionEvent value used for other.
Returns
The result of the obtain operation.
- Attributes
Remarks
Create a new MotionEvent, copying from an existing one.
Java documentation for android.view.MotionEvent.obtain(android.view.MotionEvent).
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.