Prevent crash

This commit is contained in:
M66B 2020-02-20 20:37:56 +01:00
parent edb35d8147
commit cdcf132c47
1 changed files with 9 additions and 6 deletions

View File

@ -4744,12 +4744,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} }
public void onItemSelected(@NonNull ViewHolder holder, boolean selected) { public void onItemSelected(@NonNull ViewHolder holder, boolean selected) {
if (accessibility && holder.view != null) { if (accessibility && holder.view != null)
AccessibilityEvent event = AccessibilityEvent.obtain(); try {
holder.view.onInitializeAccessibilityEvent(event); AccessibilityEvent event = AccessibilityEvent.obtain();
event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED); holder.view.onInitializeAccessibilityEvent(event);
holder.view.getParent().requestSendAccessibilityEvent(holder.view, event); event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED);
} holder.view.getParent().requestSendAccessibilityEvent(holder.view, event);
} catch (Throwable ex) {
Log.w(ex);
}
} }
@Override @Override