File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -922,15 +922,20 @@ public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
922922 if (selectedView != null ) {
923923 event .setEnabled (selectedView .isEnabled ());
924924 }
925+ event .setCurrentItemIndex (getSelectedItemPosition ());
925926 event .setFromIndex (getFirstVisiblePosition ());
926927 event .setToIndex (getLastVisiblePosition ());
927928 event .setItemCount (getAdapter ().getCount ());
928929 }
929930
930931 private boolean isScrollableForAccessibility () {
931- final int itemCount = getAdapter ().getCount ();
932- return itemCount > 0
933- && (getFirstVisiblePosition () > 0 || getLastVisiblePosition () < itemCount - 1 );
932+ T adapter = getAdapter ();
933+ if (adapter != null ) {
934+ final int itemCount = adapter .getCount ();
935+ return itemCount > 0
936+ && (getFirstVisiblePosition () > 0 || getLastVisiblePosition () < itemCount - 1 );
937+ }
938+ return false ;
934939 }
935940
936941 @ Override
You can’t perform that action at this time.
0 commit comments