diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 1ac0727c5a..5bf4740a5a 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -1813,6 +1813,7 @@ public class AdapterMessage extends RecyclerView.Adapter attachments = db.attachment().getAttachments(message.id); + properties.setAttachments(message.id, attachments); boolean signed_data = false; for (EntityAttachment attachment : attachments) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 7846bf3fa6..6b47302690 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -289,13 +289,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. private Long closeId = null; private int autoCloseCount = 0; private boolean autoExpanded = true; - private Map kv = new HashMap<>(); - private Map> values = new HashMap<>(); - private LongSparseArray sizes = new LongSparseArray<>(); - private LongSparseArray heights = new LongSparseArray<>(); - private LongSparseArray> positions = new LongSparseArray<>(); - private LongSparseArray> attachments = new LongSparseArray<>(); - private LongSparseArray accountSwipes = new LongSparseArray<>(); + + final private Map kv = new HashMap<>(); + final private Map> values = new HashMap<>(); + final private LongSparseArray sizes = new LongSparseArray<>(); + final private LongSparseArray heights = new LongSparseArray<>(); + final private LongSparseArray> positions = new LongSparseArray<>(); + final private LongSparseArray> attachments = new LongSparseArray<>(); + final private LongSparseArray accountSwipes = new LongSparseArray<>(); private NumberFormat NF = NumberFormat.getNumberInstance(); @@ -1531,12 +1532,16 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. @Override public void setAttachments(long id, List list) { - attachments.put(id, list); + synchronized (attachments) { + attachments.put(id, list); + } } @Override public List getAttachments(long id) { - return attachments.get(id); + synchronized (attachments) { + return attachments.get(id); + } } public void scrollTo(final int pos, final int y) {