Android ACTION_SEND超链接在GMail中无法工作 [英] Android ACTION_SEND Hyperlink not working in GMail

查看:243
本文介绍了Android ACTION_SEND超链接在GMail中无法工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在Android中发送HTML电子邮件的代码,可以点击链接。

This is my code for sending an HTML email in Android, with a clickable link.

private void sendEmail()
{

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String subject = "Prueba";
String emailtext = "<a href=http://www.google.es>PruebaEmail</a>";
emailIntent.setType("message/rfc822");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailtext.toString()));

startActivity(Intent.createChooser(emailIntent, "Send mail"));
}

几个月前,它正在工作并发送可点击的超链接,但现在,当我收到我的GMail帐户中的邮件时,没有超链接,只是纯文本。

Months ago, it was working and sends a clickable hyperlink, but for now, when I receive the mail in my GMail account, there is no hyperlink, just plain text.

我已经尝试了所有这些类型:

I have tried all of this in the type:

emailIntent.setType("message/rfc822");

emailIntent.setType("plain/text");

emailIntent.setType("text/html");

这个文字:

String emailtext = "<a href=http://www.google.es>PruebaEmail</a>";

String emailtext = "<a href='http://www.google.es'>PruebaEmail</a>";

String emailtext = "<a href="http://www.google.es">PruebaEmail</a>";

但没有一个正常工作。

这个问题只适用于GMail,因为如果我将邮件发送到Evernote或其他应用程序,我可以点击链接。

This issue is just for GMail, because if I send the mail to Evernote or another app, I got a clickable link.

这是我的API配置:

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8"/>

并使用Android 3.2进行编译

and compiling with Android 3.2

任何想法?

推荐答案

OK终于找到了解决方案的工作。
href和外部的链接必须完全相同。
删除我的评论他们现在不相关。

OK finally found the solution for the things to work. The link in the href and outside has to be exactly same. Deleted my comments they are now irrelevant.

问题是与gmail客户端4.2.2我有最新的一个似乎:)
gmail客户端4.1.2为href标签工作正常,你写的是什么。

The problem is with gmail client 4.2.2 i have the latest one it seems :) The gmail client 4.1.2 worked just fine for the href tag what you had written.

它的gmail客户端真的很笨,这样工作。

And its really stupid of the gmail client to work like this.

这篇关于Android ACTION_SEND超链接在GMail中无法工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆