Android - Custom View

> Android

1 - About

Custom view

3 - Layout file

Android - Layout File (XML)

<com.myapp.myView
     android:height="..."
     android:width="..."
/>
Advertising

4 - Accessibility

To get access to the AccessibilityManager instance, use this code:

// Send an event to the accessibility Manager
AccessibilityManager accessibilityManager =  (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
if (accessibilityManager.isEnabled()) {
    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED);
}
 
// Handle the event in the custom view ?
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent ev) {
  ev.getText.add("What you want?");
}

5 - Documentation / Reference