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