简体   繁体   English

在电子邮件android中设置可点击链接

[英]set clickable link in email android

i want an automatic mail filled in when i click on the email address. 我要在单击电子邮件地址时填写自动邮件。 but for some reason the html <-a href="link">here<-/a> doesn't works. 但出于某些原因,html <-a href =“ link”>此处<-/ a>不起作用。 here is my code, hopefully somebody has some experience with this in android. 这是我的代码,希望有人对此有一定的经验。

here is my code in my onclicklistener: 这是我的onclicklistener中的代码:

 String link="http://www.thisisthelink.com";
            String body=
                    "following link:<a href="+link+">hier</a>";

            Intent email = new Intent(Intent.ACTION_SEND);
            email.putExtra(Intent.EXTRA_EMAIL, new String[]{current.getOuder_email()});
            email.putExtra(Intent.EXTRA_SUBJECT, "SUBJECT");
            email.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body));
            email.setType("message/rfc822");
            startActivityForResult(Intent.createChooser(email, "Email"),1);

You can try to read about Spannable and especially Clickable Span. 您可以尝试阅读有关Spannable,尤其是Clickable Span的信息。 Take a look at similar question this might help you. 看看类似的问题,这可能会对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM