0

in my app i have several different social media links, from different plattforms and im trying to build an intent that launches the appropriate App if there is one. And if not hands off the link to the browser.

For example there is faceboook:

facebook://facebook.com/username

This works great, if i have the facebook app it is launched and the given address is loaded.

now the same user also has a googleplus,twitter, Xing, Youtube.

If i try this:

String socialNetwork = "http://m.youtube.com/user/username"
startActivity(Intent.createChooser(new Intent(Intent.ACTION_VIEW, Uri.parse(socialNetwork)), "Open with:"));

The address is opened in a Browers window. But i want it to open with the installed YouTube App. Or twiiter or googleplus or xing based on the link i try to open.

user2162545
  • 118
  • 4

1 Answers1

1

From my understanding, to do this kind of jobs, all we have is the ACTION_VIEW. There is no "social network intent". You have to manually check what app you want to open by yourself. For example, this one is for Youtube. Here is for Twitter.

Hope this helps.

Community
  • 1
  • 1
pt2121
  • 11,720
  • 8
  • 52
  • 69