Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a Twitter tweet by native Twitter app on android

A tweet can be opened by Browser with the link of format:

http://twitter.com/1Direction_X/statuses/197752514391715842

How do I open the above tweet by the native Twitter app from my app.

With iOS, I can do by this statement:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"twitter://status?id=197752514391715842"]];

Thank you!

like image 241
vietstone Avatar asked Dec 04 '22 16:12

vietstone


2 Answers

On Android, you can use this link to open the tweet in the native Twitter app

twitter://status?status_id=197752514391715842

like image 65
Tasha Avatar answered Dec 07 '22 04:12

Tasha


You normally use the Intent.ACTION_SEND intent to open up the share dialog, where users can then select the twitter app.

I've found this tutorial that can be used to launch the twitter app directly: http://blog.rafaelsanches.com/2010/06/18/using-native-twitter-app-intent-to-share-on-android/

like image 42
Thom Wiggers Avatar answered Dec 07 '22 06:12

Thom Wiggers