

Open Google Plus via Intent In Android
source link: https://www.codesd.com/item/open-google-plus-via-intent-in-android.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Open Google Plus via Intent In Android
I have a Google Plus
page
https://plus.google.com/u/0/b/101839105638971401281/101839105638971401281/posts
and an Android application. I want to open this page in my app. I don't want to open the browser!
This opens the browser:
URL="https://plus.google.com/b/101839105638971401281/101839105638971401281/posts";
uri = Uri.parse(URL);
it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
this crashes:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName("com.google.android.apps.plus", "com.google.android.apps.plus.phone.UrlGatewayActivity");
intent.putExtra("customAppUri", "10183910563897140128");
startActivity(intent);
Thanks in advance!
[SOLVED]
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://plus.google.com/101839105638971401281/posts")));
With this solution the user can choose the Google Plus APP or open the browser. If the APP is chosen, there is no crash.
If the user has the Google+ app installed, you can do this:
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://plus.google.com/101839105638971401281/posts")));
Notice the syntax of the URI, and that it doesn't contain /b/id/
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK