AccessibleStateSet () { AccessibleStateSet set = super.getAccessibleStateSet(); if (!myLeaf) { // Add expandable+expanded/collapsed states so that screen readers announce // that this is an item that can be expanded (or collapsed). set.add(AccessibleState.EXPANDABLE); set.add(myExpanded ? AccessibleState.EXPANDED : AccessibleState.COLLAPSED); } return set; }