2012-05-02 11 views
6

Following this example w innym wątku, jestem w stanie ćwierkać albo URL:Jak ćwierkać zarówno URL i hashtagami

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)); 

który pokazuje się jako:

umieścić tekst TUTAJ https://www.google.com

lub z hashtagiem:

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)); 

który pokazuje się jako:

PUT tekst #android #twitter

Ale z jakiegoś powodu, nie jestem w stanie pokazać zarówno URL i hashtags w pudełko twitter.

Co robię źle?

Odpowiedz

6

Odpowiadając na moje własne pytanie: tam nie powinien być miejscem poprzedzającym &hashtags. Innymi słowy, powyższe powinno być napisane:

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)); 

Mam nadzieję, że to komuś pomaga.

Powiązane problemy