From a7cc493922af68c549b89767aa1e08273b64e1c1 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 28 Dec 2022 15:10:23 +0100 Subject: [PATCH] Fix issue #690 - Crash when visiting a profile with a lot of media --- .../java/app/fedilab/android/ui/drawer/ImageAdapter.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java index 1497f97d..41d48218 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ImageAdapter.java @@ -78,11 +78,9 @@ public class ImageAdapter extends RecyclerView.Adapter holder.binding.media.setOnClickListener(v -> { Intent mediaIntent = new Intent(context, MediaActivity.class); Bundle b = new Bundle(); - b.putInt(Helper.ARG_MEDIA_POSITION, position + 1); + b.putInt(Helper.ARG_MEDIA_POSITION, 1); ArrayList attachmentsTmp = new ArrayList<>(); - for (Status status1 : statuses) { - attachmentsTmp.add(status1.art_attachment); - } + attachmentsTmp.add(status.art_attachment); b.putSerializable(Helper.ARG_STATUS, status); b.putSerializable(Helper.ARG_MEDIA_ARRAY, new ArrayList<>(attachmentsTmp)); mediaIntent.putExtras(b);