【发布时间】:2012-08-05 18:25:52
【问题描述】:
我有一个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);
这会崩溃:
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);
提前致谢!
[已解决]
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://plus.google.com/101839105638971401281/posts")));
使用此解决方案,用户可以选择 Google Plus APP 或打开浏览器。如果选择了APP,则不会崩溃。
【问题讨论】:
-
如何将 WebView 嵌入到您的应用中并在其中加载页面?
-
因为我更喜欢直接打开浏览器。
-
Google+ 社区怎么样? stackoverflow.com/questions/23075842/…
-
现在变成了 com.google.android.libraries.social.gateway.GatewayActivity
标签: android android-intent google-plus