相关疑难解决方法(0)

通过Intent在Android中打开Goog​​le Plus页面

我有一个Google Plus页面

https://plus.google.com/u/0/b/101839105638971401281/101839105638971401281/posts

和一个Android应用程序.我想在我的应用中打开此页面.我不想打开浏览器!

这将打开浏览器:

URL="https://plus.google.com/b/101839105638971401281/101839105638971401281/posts";
uri = Uri.parse(URL);
it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
Run Code Online (Sandbox Code Playgroud)

这次崩溃:

 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);
Run Code Online (Sandbox Code Playgroud)

提前致谢!

[解决了]

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://plus.google.com/101839105638971401281/posts")));
Run Code Online (Sandbox Code Playgroud)

使用此解决方案,用户可以选择Google Plus APP或打开浏览器.如果选择APP,则不会发生崩溃.

android android-intent google-plus

21
推荐指数
2
解决办法
1万
查看次数

标签 统计

android ×1

android-intent ×1

google-plus ×1