通过Gmail发送带自定义方案的链接 [英] Send link with custom scheme through Gmail
本文介绍了通过Gmail发送带自定义方案的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
String body =< a href = \'myscheme:// myurl?id = 37 \'>链接到模拟< / a>;
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType(text / html);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,share);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,Html.fromHtml(body));
startActivity(Intent.createChooser(emailIntent,Email:));
但是,当我通过上面的代码和通过桌面Chrome浏览器的Gmail获取电子邮件时,
当我发送 http:// myurl
时,我可以看到链接。
是否可以使用自定义方案发送链接?
解决方案
使用tinyurl api生成短链接 http://tinyurl.com/api-create。 php?url = myscheme:// myurl?id = 37
您得到 http://tinyurl.com/ofmudsw
I'm trying to send a deep link that opens my Android app:
String body = "<a href=\'myscheme://myurl?Id=37\'>Link to simulation</a>";
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "share");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
startActivity(Intent.createChooser(emailIntent, "Email:"));
But when I got the email with the code above and with my Gmail through desktop chrome brower I got only plain text.
When I send http://myurl
I do get the link.
Is it possible to send link with custom scheme?
解决方案
Use tinyurl api to generate short link http://tinyurl.com/api-create.php?url=myscheme://myurl?Id=37
you get http://tinyurl.com/ofmudsw
这篇关于通过Gmail发送带自定义方案的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文