Example usage for android.view.accessibility AccessibilityEvent setAddedCount

List of usage examples for android.view.accessibility AccessibilityEvent setAddedCount

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityEvent setAddedCount.

Prototype

public void setAddedCount(int addedCount) 

Source Link

Document

Sets the number of added characters.

Usage

From source file:com.android.calendar.event.EditEventView.java

private void sendAccessibilityEvent() {
    AccessibilityManager am = (AccessibilityManager) mActivity.getSystemService(Service.ACCESSIBILITY_SERVICE);
    if (!am.isEnabled() || mModel == null) {
        return;//from  www.  j  a va2s . c o  m
    }
    StringBuilder b = new StringBuilder();
    addFieldsRecursive(b, mView);
    CharSequence msg = b.toString();

    AccessibilityEvent event = AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_FOCUSED);
    event.setClassName(getClass().getName());
    event.setPackageName(mActivity.getPackageName());
    event.getText().add(msg);
    event.setAddedCount(msg.length());

    am.sendAccessibilityEvent(event);
}