From 39f3fe8601c6e50f4e42b1b7b353ca1714140c52 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 3 Jul 2022 15:57:29 +0200 Subject: [PATCH] little fix --- .../app/fedilab/android/BaseMainActivity.java | 2 +- .../android/activities/ComposeActivity.java | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index 5c065e49..6fe89afc 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -405,7 +405,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt if (imageUri != null) { intent = new Intent(BaseMainActivity.this, ComposeActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); - intent.putExtra(Helper.ARG_SHARE_URI, imageUri.toString()); + intent.putExtra(Helper.ARG_SHARE_URI, imageUri); startActivity(intent); } else { Toasty.warning(BaseMainActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show(); diff --git a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java index fb8f5d84..0ddda757 100644 --- a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java @@ -358,12 +358,19 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana }, 0, 10000); if (sharedUriList != null && sharedUriList.size() > 0) { - List uris = new ArrayList<>(sharedUriList); - composeAdapter.addAttachment(-1, uris); + + Handler handler = new Handler(); + handler.postDelayed(() -> { + List uris = new ArrayList<>(sharedUriList); + composeAdapter.addAttachment(-1, uris); + }, 1000); } else if (sharedUri != null && !sharedUri.toString().startsWith("http")) { - List uris = new ArrayList<>(); - uris.add(sharedUri); - composeAdapter.addAttachment(-1, uris); + Handler handler = new Handler(); + handler.postDelayed(() -> { + List uris = new ArrayList<>(); + uris.add(sharedUri); + composeAdapter.addAttachment(-1, uris); + }, 1000); } else if (shareURL != null) { Helper.download(ComposeActivity.this, sharedUrlMedia, new OnDownloadInterface() { @Override