From b2997138073b7b977361262d9df057ba6946c4f6 Mon Sep 17 00:00:00 2001 From: cketti Date: Thu, 30 Jan 2014 02:47:10 +0100 Subject: [PATCH] Support extras for ACTION_VIEW + mailto: URI Support the extras documented for ACTION_SEND to be used with ACTION_VIEW to support another app that doesn't care, namely Twitter. --- src/com/fsck/k9/activity/MessageCompose.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 3bf6e900d..9c6aa9856 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -917,8 +917,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, final String action = intent.getAction(); if (Intent.ACTION_VIEW.equals(action) || Intent.ACTION_SENDTO.equals(action)) { - startedByExternalIntent = true; - /* * Someone has clicked a mailto: link. The address is in the URI. */ @@ -930,21 +928,21 @@ public class MessageCompose extends K9Activity implements OnClickListener, } /* - * Note: According to the documenation ACTION_VIEW and ACTION_SENDTO don't accept + * Note: According to the documentation ACTION_VIEW and ACTION_SENDTO don't accept * EXTRA_* parameters. * And previously we didn't process these EXTRAs. But it looks like nobody bothers to * read the official documentation and just copies wrong sample code that happens to * work with the AOSP Email application. And because even big players get this wrong, - * we're now finally giving in and read the EXTRAs for ACTION_SENDTO (below). + * we're now finally giving in and read the EXTRAs for those actions (below). */ } if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action) || - Intent.ACTION_SENDTO.equals(action)) { + Intent.ACTION_SENDTO.equals(action) || Intent.ACTION_VIEW.equals(action)) { startedByExternalIntent = true; /* - * Note: Here we allow a slight deviation from the documentated behavior. + * Note: Here we allow a slight deviation from the documented behavior. * EXTRA_TEXT is used as message body (if available) regardless of the MIME * type of the intent. In addition one or multiple attachments can be added * using EXTRA_STREAM.