how can i launch a app form other on Android

89 Views Asked by At

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?

3

There are 3 best solutions below

0
On
0
On

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)));
}
0
On

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