From 8d264b159eef75345833fc68eb637ae97f5f1eef Mon Sep 17 00:00:00 2001 From: Koji Arai Date: Mon, 18 Jul 2011 00:53:49 +0900 Subject: [PATCH 1/3] Workaround for below issue. 1. Show a message in MessageView. 2. Press HOME button to back home. 3. Re-launch the K-9 and select another message. 4. Show first selected message. See also: https://github.com/k9mail/k-9/commit/fix_activity_stack --- src/com/fsck/k9/activity/MessageView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 937e4e035..0698e90d1 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -368,6 +368,7 @@ public class MessageView extends K9Activity implements OnClickListener { i.putExtra(EXTRA_MESSAGE_REFERENCE, messRef); i.putParcelableArrayListExtra(EXTRA_MESSAGE_REFERENCES, messReferences); i.putExtra(EXTRA_ORIGINATING_INTENT, originatingIntent); + i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK ); if (extras != null) { i.putExtras(extras); } From e9e9d5afcbe5501c6e1d8e616f2cf495456f2ae1 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 31 Aug 2011 02:12:01 +0200 Subject: [PATCH 2/3] Removed unused method --- src/com/fsck/k9/activity/MessageView.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 0698e90d1..9a1fe2ca1 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -349,29 +349,20 @@ public class MessageView extends K9Activity implements OnClickListener { } - - public static void actionView(Context context, MessageReference messRef, ArrayList messReferences, final Intent originatingIntent) { - actionView(context, messRef, messReferences, null, originatingIntent); - } - /** * @param context * @param messRef * @param messReferences - * @param extras * @param originatingIntent * The intent that allow us to get back to the calling screen, for when the 'Manage * BACK' option is enabled. Never {@code null}. */ - public static void actionView(Context context, MessageReference messRef, ArrayList messReferences, Bundle extras, final Intent originatingIntent) { + public static void actionView(Context context, MessageReference messRef, ArrayList messReferences, final Intent originatingIntent) { Intent i = new Intent(context, MessageView.class); i.putExtra(EXTRA_MESSAGE_REFERENCE, messRef); i.putParcelableArrayListExtra(EXTRA_MESSAGE_REFERENCES, messReferences); i.putExtra(EXTRA_ORIGINATING_INTENT, originatingIntent); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK ); - if (extras != null) { - i.putExtras(extras); - } context.startActivity(i); } From f6a647d7b0cc85f2d836de82a2b6ecebf7fab1ad Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 31 Aug 2011 02:17:45 +0200 Subject: [PATCH 3/3] Cosmetic changes --- src/com/fsck/k9/activity/MessageView.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 9a1fe2ca1..d1df6dcad 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -124,7 +124,7 @@ public class MessageView extends K9Activity implements OnClickListener { } @Override - public void onMount(String providerId) {} // no-op + public void onMount(String providerId) { /* no-op */ } } @@ -354,15 +354,16 @@ public class MessageView extends K9Activity implements OnClickListener { * @param messRef * @param messReferences * @param originatingIntent - * The intent that allow us to get back to the calling screen, for when the 'Manage - * BACK' option is enabled. Never {@code null}. + * The intent that allow us to get back to the calling screen, for when the 'Manage + * "Back" button' option is enabled. Never {@code null}. */ - public static void actionView(Context context, MessageReference messRef, ArrayList messReferences, final Intent originatingIntent) { + public static void actionView(Context context, MessageReference messRef, + ArrayList messReferences, final Intent originatingIntent) { Intent i = new Intent(context, MessageView.class); i.putExtra(EXTRA_MESSAGE_REFERENCE, messRef); i.putParcelableArrayListExtra(EXTRA_MESSAGE_REFERENCES, messReferences); i.putExtra(EXTRA_ORIGINATING_INTENT, originatingIntent); - i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK ); + i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } @@ -426,7 +427,7 @@ public class MessageView extends K9Activity implements OnClickListener { } else { List segmentList = uri.getPathSegments(); if (segmentList.size() != 3) { - //TODO: Use ressource to externalize message + //TODO: Use resource to externalize message Toast.makeText(this, "Invalid intent uri: " + uri.toString(), Toast.LENGTH_LONG).show(); return; } @@ -442,7 +443,7 @@ public class MessageView extends K9Activity implements OnClickListener { } } if (!found) { - //TODO: Use ressource to externalize message + //TODO: Use resource to externalize message Toast.makeText(this, "Invalid account id: " + accountId, Toast.LENGTH_LONG).show(); return; }