我有一個Google Plus
頁面打開谷歌加威盛意圖在Android中
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")));
通過這一解決方案,用戶可以選擇谷歌加APP或打開瀏覽器。如果選擇APP,則不會崩潰。
如何將WebView嵌入您的應用程序並在其中加載頁面? – Nick 2012-08-08 15:37:06
因此我更願意直接打開瀏覽器。 – benoffi7 2012-08-08 16:17:27
Google+社區如何?http://stackoverflow.com/questions/23075842/android-intent-to-launch-google-app-at-google-community-screen – 2014-04-15 11:37:54