Rate This Document
Findability
Accuracy
Completeness
Readability

onTouch

Function Usage

Responds to touch events. This function rewrites the native Android API. It is called when a touch event is distributed to a view, allowing the listener to respond before the target view.

Restrictions

N/A

Prototype

boolean onTouch(View view, MotionEvent event)

Parameters

Field Name

Input/Output

Field Type

Description

view

Input

View

Canvas for responding to touch events

event

Input

MotionEvent

Detailed information about touch events

Returns

Data type: boolean

The value can be:

  • true: The touch event is successfully injected.
  • false: The touch event fails to be injected.

Example Call

1
2
3
4
5
6
7
void Test()  
{ 
    VmiTouch instance = VmiTouch.getInstance();
    View view;
    MotionEvent event;
    instance.OnTouch(view, event);
}