From 4ac2daa54912b708b940e03e6136a2f8476d1814 Mon Sep 17 00:00:00 2001 From: Hocuri Date: Fri, 12 Jun 2020 17:11:03 +0200 Subject: [PATCH] start ConversationListActivity with startActivityForResult() so that the conversations list is correctly updated before and after sharing. Now it always correctly shows or does not show the devicetalk. Second try after https://github.com/deltachat/deltachat-android/pull/1402. --- src/org/thoughtcrime/securesms/ShareActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/ShareActivity.java b/src/org/thoughtcrime/securesms/ShareActivity.java index 896bd589f..f3e42589d 100644 --- a/src/org/thoughtcrime/securesms/ShareActivity.java +++ b/src/org/thoughtcrime/securesms/ShareActivity.java @@ -42,6 +42,7 @@ import org.thoughtcrime.securesms.util.RelayUtil; import java.util.ArrayList; import java.util.List; +import static org.thoughtcrime.securesms.util.RelayUtil.REQUEST_RELAY; import static org.thoughtcrime.securesms.util.RelayUtil.setSharedText; /** @@ -206,7 +207,9 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity implement if (chatId != -1) { RelayUtil.setDirectSharing(composeIntent, chatId); } - startActivity(composeIntent); + startActivityForResult(composeIntent, REQUEST_RELAY); + // We use startActivityForResult() here so that the conversations list is correctly updated. (hide "Device messages", ...)a + // With startActivity() the list was not always updated before and after sharing and incorrectly showed or did not show the device talk. finish(); }