如何既鸣叫URL和#标签 [英] How to tweet both URL and Hashtags

查看:101
本文介绍了如何既鸣叫URL和#标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着这个例子的另一个线程,我能够鸣叫的的网址:

Following this example on another thread, I am able to tweet either the URL:

String tweetUrl = "https://twitter.com/intent/tweet?text=PUT TEXT HERE &url="
                        + "https://www.google.com";
Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

其显示为:

把文本放在这 https://www.google.com

的#标签:

String tweetUrl = "https://twitter.com/intent/tweet?text=PUT TEXT HERE &url="
                        + "https://www.google.com &hashtags=android,twitter";
Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

其显示为:

把文本放在这#android #twitter

PUT TEXT HERE #android #twitter

但由于某些原因,我无法显示的两个的URL,并在微博中的#标签。

But for some reason, I am unable to show both the URL and the hashtags in the twitter box.

我是什么做错了吗?

推荐答案

回答我的问题:有不应该是前一个空格&放大器;#标签。换言之,上述应写:

Answering my own question: There shouldn't be a space before &hashtags. In other words, the above should be written:

String tweetUrl = "https://twitter.com/intent/tweet?text=PUT TEXT HERE &url="
                        + "https://www.google.com&hashtags=android,twitter";
Uri uri = Uri.parse(tweetUrl);
startActivity(new Intent(Intent.ACTION_VIEW, uri));

希望这可以帮助别人。

Hope this helps someone.

这篇关于如何既鸣叫URL和#标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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