Possible Duplicate:
Android Intent for Twitter application
I want to go to follow page from my android app and i want this to be done by starting the native twitter app.
How can i do this and also if a twitter client is not there in user's mobile it should go in mobile web site of twitter.
From my testing, I couldn't find a nice way to do this, and instead resorted to a solution that is not necessarily 'best practice'. It works only with the official twitter app and not with the others. This solution will fail if the official app changes its internal API. Therefore, please use this solution with caution and know its limitations.
This code is not written in a good way, but it does work. My advice is to change it to not use so many resources.
The code checks to see whether the Twitter app is installed. If so, the Twitter app is launched; otherwise, the browser is launched.
Twitter has twitter name (also named screen_name) and twitter id: they are not the same.
List all packages that reply to
ACTION_SEND
and filter them on most popular known twitter clients. http://regis.decamps.info/blog/2011/06/intent-to-open-twitter-client-on-android/To check if an Intent exists try this:
(source)
For twitter check this snippet:
(source)
Since the last version of Twitter app 3.0.0 at the Dec 9 2011, the official twitter app support the regular intent mechanism. All you need to do is to use the regular intent for the browser, in case that it will be a twitter valid address the official app is registered as one of the resolver of this intent.
... just copy and paste the comment of goBeepit dev because works for me, the android ask you for open in browser or twitter app, what I've use its just this