-2

How I can launch a Twitter application from another Android application? For example, in my application I have some social buttons when I pushed the button of Twitter now gone to twitter page, but I want to launch the twitter application. How I can do that?

tux3
  • 7,171
  • 6
  • 39
  • 51

3 Answers3

0

You need to use an intent, check here: http://developer.android.com/reference/android/content/Intent.html

Kamila Brito
  • 198
  • 8
0

You can try this:

try {
   startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=" + twitter_user_name)));
}catch (Exception e) {
   startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/#!/" + twitter_user_name)));
}
Panayiotis Irakleous
  • 2,696
  • 1
  • 23
  • 36
0

You should use an implict intent.you can read about it in general here, and there is a more specific solution for you here

Community
  • 1
  • 1
user3629774
  • 82
  • 3
  • 7