diff options
author | ByteHamster <info@bytehamster.com> | 2022-04-09 16:08:52 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-04-09 16:08:52 +0200 |
commit | e385d4c02190d5237098022949bb5e68bd224a1e (patch) | |
tree | b59a42b20203ecbf4e3354447427c5efed181473 /app/src | |
parent | 1cc1fa1d126f1cbf375b25b715d0937bd73982f9 (diff) | |
download | AntennaPod-e385d4c02190d5237098022949bb5e68bd224a1e.zip |
Fix ArrayIndexOutOfBoundsException reported through Google Play
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java | 5 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java index 0ad7fa219..53223896f 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/EpisodeItemListAdapter.java @@ -84,7 +84,7 @@ public class EpisodeItemListAdapter extends SelectableAdapter<EpisodeItemViewHol }); holder.itemView.setOnCreateContextMenuListener(this); holder.itemView.setOnLongClickListener(v -> { - longPressedItem = getItem(holder.getBindingAdapterPosition()); + longPressedItem = item; longPressedPosition = holder.getBindingAdapterPosition(); return false; }); @@ -92,7 +92,7 @@ public class EpisodeItemListAdapter extends SelectableAdapter<EpisodeItemViewHol if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (e.isFromSource(InputDevice.SOURCE_MOUSE) && e.getButtonState() == MotionEvent.BUTTON_SECONDARY) { - longPressedItem = getItem(holder.getBindingAdapterPosition()); + longPressedItem = item; longPressedPosition = holder.getBindingAdapterPosition(); return false; } @@ -127,6 +127,7 @@ public class EpisodeItemListAdapter extends SelectableAdapter<EpisodeItemViewHol holder.itemView.setOnClickListener(null); holder.itemView.setOnCreateContextMenuListener(null); holder.itemView.setOnLongClickListener(null); + holder.itemView.setOnTouchListener(null); holder.secondaryActionButton.setOnClickListener(null); holder.dragHandle.setOnTouchListener(null); holder.coverHolder.setOnTouchListener(null); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java index 5ab354d05..492d49759 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsRecyclerAdapter.java @@ -118,7 +118,7 @@ public class SubscriptionsRecyclerAdapter extends SelectableAdapter<Subscription if (isFeed) { longPressedPosition = holder.getBindingAdapterPosition(); } - selectedItem = (NavDrawerData.DrawerItem) getItem(holder.getBindingAdapterPosition()); + selectedItem = drawerItem; } return false; }); @@ -131,7 +131,7 @@ public class SubscriptionsRecyclerAdapter extends SelectableAdapter<Subscription if (isFeed) { longPressedPosition = holder.getBindingAdapterPosition(); } - selectedItem = (NavDrawerData.DrawerItem) getItem(holder.getBindingAdapterPosition()); + selectedItem = drawerItem; } } } |