在MessageCompose.java中将else if (ACTION_REPLY.equals(mAction)
- || ACTION_REPLY_ALL.equals(mAction)
- || ACTION_FORWARD.equals(mAction)) {
}中ACTION_FORWARD提取成:
else if(ACTION_FORWARD.equals(mAction)) {+ Log.d("Email", "In ACTION_FORWARD.equals(mAction)");
+ mLoadAttachmentsTask = new AsyncTask() {
+ @Override
+ protected Attachment[] doInBackground(Long... messageIds) {
+ Attachment[] attachments = Attachment.restoreAttachmentsWithMessageId(MessageCompose.this,
+ messageIds[0]);
+ return attachments;
+ }
+ @Override
+ protected void onPostExecute(Attachment[] attachments) {
+ if (attachments == null) {
+ return;
+ }
+ int size = attachments.length;
+ Log.d("Email", "attachments.length : " +size);
+ for (int i = 0 ; i < size; i++)
+ {
+ Log.d("Email", "Attachment Size -- : " + i);
+ addAttachment(Uri.parse(attachments[i].mContentUri));
+ }
+ }
+ }.execute(message.mId);
试过在163,126等邮箱成功,gmail失败,应该是不同邮箱机制不同导致,前者是将邮件内容下载到了本地,
而后者为了用户体验没有将邮件内容下载到本地,关于gmail这一类的邮件服务还需改进。
阅读(2146) | 评论(0) | 转发(0) |