Skip to main content
Logo Appt Light

Accessibility action on Android

Accessibility actions provide alternative ways for users of assistive technologies to perform actions. For users of switch control it can be difficult to use drag-and-drop functionality. This functionality can be made more accessible by providing accessibility actions to move items up and down.

On Android, you can add actions for assistive technologies using ViewCompat.addAccessibilityAction helper method. Or you can use the the addAction directly via AccessibilityNodeInfoCompat.

// Add custom action
ViewCompat.addAccessibilityAction(view, "Add bookmark") { view, arguments ->
    // Bookmark logic

// Override click action label
ViewCompat.setAccessibilityDelegate(view, new AccessibilityDelegateCompat() {
    public void onInitializeAccessibilityNodeInfo(
        View host,
        AccessibilityNodeInfoCompat info)
        super.onInitializeAccessibilityNodeInfo(host, info)
        AccessibilityActionCompat action = new AccessibilityActionCompat(
            "Add bookmark"


Let us know!