I have this code in the ActionBarSherlock
@Override
public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event)
{
if (super.onRequestSendAccessibilityEvent(child, event)) {
// Add a record for ourselves as well.
AccessibilityEvent record = AccessibilityEvent.obtain();
onInitializeAccessibilityEvent(record);
// Populate with the text of the requesting child.
child.dispatchPopulateAccessibilityEvent(record);
event.appendRecord(record);
return true;
}
return false;
}
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
info.setScrollable(isScrollableForAccessibility());
View selectedView = getSelectedView();
if (selectedView != null) {
info.setEnabled(selectedView.isEnabled());
}
}
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setScrollable(isScrollableForAccessibility());
View selectedView = getSelectedView();
if (selectedView != null) {
event.setEnabled(selectedView.isEnabled());
}
event.setCurrentItemIndex(getSelectedItemPosition());
event.setFromIndex(getFirstVisiblePosition());
event.setToIndex(getLastVisiblePosition());
event.setItemCount(getCount());
}
And I get compile errors on super.onInitializeAccessibilityEvent(event); and a few other methods.
Would anyone know why this happens?
Thanks!
The complaint is that your android:minSdkVersion
is set to 8, and that code is referring to classes, methods, or fields that were not added until API Level 14.
If you are attempting to modify ActionBarSherlock and compile it yourself, you can either add the appropriate code to deal with this (checking Build.VERSION.SDK_INT
) and add the @TargetApi()
annotation to stop Lint from complaining.