Search code examples
androidtwitter

Open page in Twitter app from other app - Android


I was looking for some way to launch Twitter app and open a specified page from my application, without webview. I found the solution for Facebook here: Opening facebook app on specified profile page

I need something similar.

[EDIT]

I've just found a solution:

try {
    Intent intent = new Intent(Intent.ACTION_VIEW,
    Uri.parse("twitter://user?screen_name=[user_name]"));
    startActivity(intent);
} catch (ActivityNotFoundException e) {
    startActivity(new Intent(Intent.ACTION_VIEW,
    Uri.parse("https://twitter.com/#!/[user_name]"))); 
}

Solution

  • This worked for me: twitter://user?user_id=id_num