Home » Android » Is there way to read YouTube Recyclerview on tap item information using accessibility service in android-Exceptionshub

Is there way to read YouTube Recyclerview on tap item information using accessibility service in android-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

I am developing one application in android that uses accessibility service but unable to read data of YouTube recyclerview item click.I am getting first click data when open the YouTube item but not getting data when click or tap on another item.

@Override
protected void onServiceConnected() {
    AccessibilityServiceInfo info=new AccessibilityServiceInfo();
    info.eventTypes=AccessibilityEvent.TYPE_VIEW_CLICKED|
            AccessibilityEvent.TYPE_VIEW_FOCUSED|
    AccessibilityEvent.TYPE_GESTURE_DETECTION_START;
    info.feedbackType=AccessibilityServiceInfo.FEEDBACK_SPOKEN| AccessibilityServiceInfo.CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT|AccessibilityServiceInfo.FEEDBACK_GENERIC|AccessibilityServiceInfo.FEEDBACK_VISUAL|AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS;

    info.notificationTimeout=30;
    this.setServiceInfo(info);
}

accessibility_service_config.xml
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service 
xmlns:android="http://schemas.android.com/apk/res/android"
android:packageNames="com.acrcloud.acrclouduniversalsdkdemo"
android:accessibilityFlags="flagDefault"
android:accessibilityFeedbackType="feedbackSpoken"
android:notificationTimeout="100"
android:accessibilityLiveRegion="polite"
android:canRetrieveWindowContent="true"

/>
How to&Answers: