From bee37b2b17e37c5e13666baa9f610ab943906eb7 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 13 Jan 2020 11:33:34 +0100 Subject: [PATCH] Small improvements --- app/src/main/java/eu/faircode/email/ActivityView.java | 5 +++-- app/src/main/java/eu/faircode/email/Core.java | 2 ++ app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java | 2 +- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 62b840f7d4..a3ae06e406 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -792,6 +792,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB Intent update = new Intent(Intent.ACTION_VIEW, Uri.parse(info.html_url)); if (update.resolveActivity(getPackageManager()) != null) { + update.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent piUpdate = PendingIntent.getActivity( ActivityView.this, REQUEST_UPDATE, update, PendingIntent.FLAG_UPDATE_CURRENT); builder.setContentIntent(piUpdate); @@ -860,11 +861,11 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB Helper.viewFAQ(this, 2); } - } else if ("alert".equals(action)) { + } else if ("alert".equals(action) || "error".equals(action)) { if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) getSupportFragmentManager().popBackStack("unified", 0); - Helper.viewFAQ(this, 23); + Helper.viewFAQ(this, "alert".equals(action) ? 23 : 22); } else if ("outbox".equals(action)) onMenuOutbox(); diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index cebcf52daa..f9507c2716 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2795,6 +2795,7 @@ class Core { // Build pending intents Intent unified = new Intent(context, ActivityView.class) .setAction("unified" + (notify_remove ? ":" + group : "")); + unified.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent piUnified = PendingIntent.getActivity(context, ActivityView.REQUEST_UNIFIED, unified, PendingIntent.FLAG_UPDATE_CURRENT); Intent clear = new Intent(context, ServiceUI.class).setAction("clear:" + group); @@ -3211,6 +3212,7 @@ class Core { static NotificationCompat.Builder getNotificationError(Context context, String channel, String title, Throwable ex) { // Build pending intent Intent intent = new Intent(context, ActivityView.class); + intent.setAction("error"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent pi = PendingIntent.getActivity( context, ActivityView.REQUEST_ERROR, intent, PendingIntent.FLAG_UPDATE_CURRENT); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index b0869a9839..8cb201b52a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -71,7 +71,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc }; private final static String[] RESET_QUESTIONS = new String[]{ - "welcome", "crash_reports_asked", "review_asked", "review_later", + "welcome", "crash_reports_asked", "review_asked", "review_later", "why", "html_always_images", "print_html_confirmed", "identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog", "setup_advanced" diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 80555ca727..9aa714d36b 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -673,6 +673,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences // Build pending intent Intent why = new Intent(this, ActivityView.class); why.setAction("why"); + why.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent piWhy = PendingIntent.getActivity(this, ActivityView.REQUEST_WHY, why, PendingIntent.FLAG_UPDATE_CURRENT); // Build notification @@ -703,6 +704,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences // Build pending intent Intent alert = new Intent(this, ActivityView.class); alert.setAction("alert"); + alert.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent piAlert = PendingIntent.getActivity(this, ActivityView.REQUEST_ALERT, alert, PendingIntent.FLAG_UPDATE_CURRENT); // Build notification