little fix

This commit is contained in:
Thomas 2022-07-03 15:57:29 +02:00
parent 499f10ea39
commit 39f3fe8601
2 changed files with 13 additions and 6 deletions

View file

@ -405,7 +405,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
if (imageUri != null) { if (imageUri != null) {
intent = new Intent(BaseMainActivity.this, ComposeActivity.class); intent = new Intent(BaseMainActivity.this, ComposeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); 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); startActivity(intent);
} else { } else {
Toasty.warning(BaseMainActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show(); Toasty.warning(BaseMainActivity.this, getString(R.string.toast_error), Toast.LENGTH_LONG).show();

View file

@ -358,12 +358,19 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
}, 0, 10000); }, 0, 10000);
if (sharedUriList != null && sharedUriList.size() > 0) { if (sharedUriList != null && sharedUriList.size() > 0) {
List<Uri> uris = new ArrayList<>(sharedUriList);
composeAdapter.addAttachment(-1, uris); Handler handler = new Handler();
handler.postDelayed(() -> {
List<Uri> uris = new ArrayList<>(sharedUriList);
composeAdapter.addAttachment(-1, uris);
}, 1000);
} else if (sharedUri != null && !sharedUri.toString().startsWith("http")) { } else if (sharedUri != null && !sharedUri.toString().startsWith("http")) {
List<Uri> uris = new ArrayList<>(); Handler handler = new Handler();
uris.add(sharedUri); handler.postDelayed(() -> {
composeAdapter.addAttachment(-1, uris); List<Uri> uris = new ArrayList<>();
uris.add(sharedUri);
composeAdapter.addAttachment(-1, uris);
}, 1000);
} else if (shareURL != null) { } else if (shareURL != null) {
Helper.download(ComposeActivity.this, sharedUrlMedia, new OnDownloadInterface() { Helper.download(ComposeActivity.this, sharedUrlMedia, new OnDownloadInterface() {
@Override @Override