Code example for AccessibilityEvent

Methods: getText

0
        super.onPopulateAccessibilityEvent(event);
 
        final int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR;
        String selectedDateUtterance = DateUtils.formatDateTime(getContext(),
                mCurrentDate.getTimeInMillis(), flags);
        event.getText().add(selectedDateUtterance);
    } 
 
    @Override 
    protected void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        setCurrentLocale(newConfig.locale);
    } 
 
    /** 
     * Sets the current locale. 
     * 
     * @param locale The current locale. 
     */ 
    private void setCurrentLocale(Locale locale) {
        if (locale.equals(mCurrentLocale)) {