diff --git a/app/src/amazon/AndroidManifest.xml b/app/src/amazon/AndroidManifest.xml
index 172d286ddd..b3e3a3c0b6 100644
--- a/app/src/amazon/AndroidManifest.xml
+++ b/app/src/amazon/AndroidManifest.xml
@@ -145,16 +145,6 @@
-
-
-
-
-
-
-
-
-
-
+ android:parentActivityName=".ActivityMain">
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+ android:parentActivityName=".ActivityMain">
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+ android:parentActivityName=".ActivityMain">
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+ android:parentActivityName=".ActivityMain">
+
+
+
+
+
+
+
+
+
+
() {
- @Override
- protected EntityMessage onExecute(Context context, Bundle args) {
- Uri data = args.getParcelable("data");
- String path = data.getPath();
- if (path == null)
- return null;
- String[] parts = path.split("/");
- if (parts.length < 1)
- return null;
- long id = Long.parseLong(parts[1]);
-
- DB db = DB.getInstance(context);
- return db.message().getMessage(id);
- }
-
- @Override
- protected void onExecuted(Bundle args, EntityMessage message) {
- finish();
-
- if (message == null)
- return;
-
- Intent thread = new Intent(ActivityMain.this, ActivityView.class);
- thread.setAction("thread:" + message.id);
- thread.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- thread.putExtra("account", message.account);
- thread.putExtra("folder", message.folder);
- thread.putExtra("thread", message.thread);
- thread.putExtra("filter_archive", true);
- thread.putExtra("pinned", true);
- thread.putExtra("msgid", message.msgid);
-
- startActivity(thread);
- }
-
- @Override
- protected void onException(Bundle args, Throwable ex) {
- // Ignored
- }
- }.execute(this, args, "message:linked");
-
- return;
- }
-
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean eula = prefs.getBoolean("eula", false);
boolean sync_on_launch = prefs.getBoolean("sync_on_launch", false);
diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java
index 681b9aa5a9..7dc9c49648 100644
--- a/app/src/main/java/eu/faircode/email/ActivityView.java
+++ b/app/src/main/java/eu/faircode/email/ActivityView.java
@@ -1455,6 +1455,54 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
ServiceUI.sync(this, null);
}
+ Uri data = intent.getData();
+ if (data != null &&
+ "message".equals(data.getScheme()) &&
+ BuildConfig.APPLICATION_ID.equals(data.getHost())) {
+ Bundle args = new Bundle();
+ args.putParcelable("data", data);
+
+ new SimpleTask() {
+ @Override
+ protected EntityMessage onExecute(Context context, Bundle args) {
+ Uri data = args.getParcelable("data");
+ String path = data.getPath();
+ if (path == null)
+ return null;
+ String[] parts = path.split("/");
+ if (parts.length < 1)
+ return null;
+ long id = Long.parseLong(parts[1]);
+
+ DB db = DB.getInstance(context);
+ return db.message().getMessage(id);
+ }
+
+ @Override
+ protected void onExecuted(Bundle args, EntityMessage message) {
+ if (message == null)
+ return;
+
+ Intent thread = new Intent();
+ thread.setAction("thread:" + message.id);
+ thread.putExtra("account", message.account);
+ thread.putExtra("folder", message.folder);
+ thread.putExtra("thread", message.thread);
+ thread.putExtra("filter_archive", true);
+ thread.putExtra("pinned", true);
+ thread.putExtra("msgid", message.msgid);
+ onViewThread(intent);
+ }
+
+ @Override
+ protected void onException(Bundle args, Throwable ex) {
+ Log.unexpectedError(getSupportFragmentManager(), ex);
+ }
+ }.execute(this, args, "message:linked");
+
+ return;
+ }
+
String action = intent.getAction();
if (action != null) {
if (action.startsWith("unified")) {
diff --git a/app/src/play/AndroidManifest.xml b/app/src/play/AndroidManifest.xml
index 733075ba5e..54663b1ce7 100644
--- a/app/src/play/AndroidManifest.xml
+++ b/app/src/play/AndroidManifest.xml
@@ -145,16 +145,6 @@
-
-
-
-
-
-
-
-
-
-
+ android:parentActivityName=".ActivityMain">
+
+
+
+
+
+
+
+
+
+