Code example for AccessibilityEvent

Methods: getEventTypegetText

     * Announce the currently-selected time when launched. 
    public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
        if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
            // Clear the event's current text so that only the current time will be spoken. 
            Time time = new Time();
            time.hour = getHours();
            time.minute = getMinutes();
            long millis = time.normalize(true);
            int flags = DateUtils.FORMAT_SHOW_TIME;
            if (mIs24HourMode) {
                flags |= DateUtils.FORMAT_24HOUR;
            String timeString = DateUtils.formatDateTime(getContext(), millis, flags);
            return true; 
        return super.dispatchPopulateAccessibilityEvent(event);
Connect your IDE to all the code out there  Get Codota for Java