find Accessibility Node Information By Text - Android User Interface

Android examples for User Interface:AccessibilityEvent

Description

find Accessibility Node Information By Text

Demo Code


//package com.java2s;

import android.view.accessibility.AccessibilityNodeInfo;

import java.util.List;

public class Main {

    public static AccessibilityNodeInfo findNodeInfosByText(
            AccessibilityNodeInfo nodeInfo, String text) {
        List<AccessibilityNodeInfo> list = nodeInfo
                .findAccessibilityNodeInfosByText(text);
        if (list == null || list.isEmpty()) {
            return null;
        }/*from  w ww.  j  ava 2 s  . co m*/
        return list.get(0);
    }
}

Related Tutorials