Open page in Facebook,Twitter and Google Plus app from other app - Android
android, android-intent, facebook, google-plus, twitter
Solution
Found a solution:
Intent intent = new Intent(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);
Problem
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 recognized if the user has a native application and if he does, I'm opening it and show him my fan page. For Twitter I use the next code: ``` try { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("twitter://user?screen_name=[user_name]")); startActivity(intent); }catch (Exception e) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://twitter.com/#!/[user_name]"))); } ``` And for Facebook the next code: ``` try{ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/" + PROFILE_FACEBOOK_APP_ID)); startActivity(intent); }catch(Exception e){ startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/UserNamePage"))); } ``` Now I want to do the same thing for Google+. I saw that I can browse to my fan page with the next Url `https://plus.google.com/MY_PAGE_ID/`, but it keep asking me if I want to open it with Google+ application or with the browser, and I want that he will open it with the application automatically, without asking the user. Is there a simple way to do this? Thanks.