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));
which shows up as:
PUT TEXT HERE https://www.google.com
or the hashtags:
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));
which shows up as:
PUT TEXT HERE #android #twitter
But for some reason, I am unable to show both the URL and the hashtags in the twitter box.
What am I doing wrong?
Answering my own question: There shouldn't be a space before
&hashtags
. In other words, the above should be written:Hope this helps someone.