Code example for AccessibilityEvent

Methods: setCurrentItemIndex, setItemCount

0
    } 
 
    @Override 
    public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
        super.onInitializeAccessibilityEvent(event);
        event.setItemCount(mMax);
        event.setCurrentItemIndex(mProgress);
    } 
 
    /** 
     * Schedule a command for sending an accessibility event. 
     * </br> 
     * Note: A command is used to ensure that accessibility events 
     *       are sent at most one in a given time frame to save 
     *       system resources while the progress changes quickly. 
     */ 
    private void scheduleAccessibilityEventSender() { 
        if (mAccessibilityEventSender == null) {
            mAccessibilityEventSender = new AccessibilityEventSender();
        } else { 
            removeCallbacks(mAccessibilityEventSender);