Example usage for android.view.accessibility AccessibilityNodeInfo ACTION_LONG_CLICK

List of usage examples for android.view.accessibility AccessibilityNodeInfo ACTION_LONG_CLICK

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityNodeInfo ACTION_LONG_CLICK.

Prototype

int ACTION_LONG_CLICK

To view the source code for android.view.accessibility AccessibilityNodeInfo ACTION_LONG_CLICK.

Click Source Link

Document

Action that long clicks on the node.

Usage

From source file:com.googlecode.eyesfree.brailleback.DefaultNavigationMode.java

private boolean longClickNode(AccessibilityNodeInfoCompat node) {
    if (node == null) {
        return false;
    }// w w w .java2 s .  c o  m
    AccessibilityNodeInfoRef current = AccessibilityNodeInfoRef.unOwned(node);
    try {
        do {
            LogUtils.log(this, Log.VERBOSE, "Considering to long click: %s", current.get().getInfo());
            if (current.get().performAction(AccessibilityNodeInfo.ACTION_LONG_CLICK)) {
                return true;
            }
        } while (current.parent());
    } finally {
        current.recycle();
    }
    LogUtils.log(this, Log.VERBOSE, "Long click action failed");
    return false;
}