open externally opened content in main activity

closes sk22#533
This commit is contained in:
sk
2023-05-31 01:44:00 +02:00
parent f9dd787009
commit bb8027c7ef
3 changed files with 60 additions and 17 deletions

View File

@@ -42,7 +42,17 @@ public class ExternalShareActivity extends FragmentStackActivity{
new AccountSwitcherSheet(this, null, true, isMastodonURL, (accountId, open) -> {
AccountSessionManager.getInstance().setLastActiveAccountID(accountId);
if (open) {
UiUtils.openURL(this, AccountSessionManager.getInstance().getLastActiveAccountID(), text, false);
UiUtils.lookupURL(this, accountId, text, false, (clazz, args) -> {
if (clazz == null) {
finish();
return;
}
args.putString("fromExternalShare", clazz.getSimpleName());
Intent intent = new Intent(this, MainActivity.class);
intent.putExtras(args);
finish();
startActivity(intent);
});
} else {
openComposeFragment(accountId);
}