Skip to content Skip to sidebar Skip to footer

Open Page In Facebook,twitter And Google Plus App From Other App - Android

I'm working on an application where I need to integrate the social functionality of the different social networks: Facebook, Twitter, Google+. For now, in Facebook and Twitter i'm

Solution 1:

Found a solution:

Intentintent=newIntent(Intent.ACTION_VIEW);
intent.setClassName("com.google.android.apps.plus",
"com.google.android.apps.plus.phone.UrlGatewayActivity");
intent.putExtra("customAppUri", "FAN_PAGE_ID");
startActivity(intent);

Solution 2:

I think this is quite safe, because we do not need to specify the component, just the google+ app package name:

Intentintent=newIntent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://plus.google.com/[Google+ID]/"));
intent.setPackage("com.google.android.apps.plus"); // don't open the browser, make sure it opens in Google+ app
startActivity(intent);

Solution 3:

Unknown if google plus needs some other information in the Intent but as general Android solution you can explicitly set the target. You will need the package name of google+.

More info here: http://developer.android.com/reference/android/content/Intent.html#setPackage%28java.lang.String%29

For example:

Intent.setPackage("com.google.android.apps.plus"); //Don't know the exact package name

Post a Comment for "Open Page In Facebook,twitter And Google Plus App From Other App - Android"