Example usage for android.app Instrumentation sendTrackballEventSync

List of usage examples for android.app Instrumentation sendTrackballEventSync

Introduction

In this page you can find the example usage for android.app Instrumentation sendTrackballEventSync.

Prototype

public void sendTrackballEventSync(MotionEvent event) 

Source Link

Document

Dispatch a trackball event.

Usage

From source file:love.juhe.androidmonkey.MonkeyTrackballEvent.java

@Override
public int fireEvent(Instrumentation inst) {
    try {/*w w w .j ava  2 s.c  o m*/
        event = getEvent();
        // System.out.println(":Touching Key (" + getTypeLabel() + "): ");
        printInfo();

        inst.sendTrackballEventSync(event);

    } catch (Exception e) {
        MonkeyLog.l(":Touching Key (" + getTypeLabel() + ") rejected ");

        return MonkeyEvent.INJECT_FAIL;

    } finally {
        event.recycle();
    }
    return MonkeyEvent.INJECT_SUCCESS;
}