【发布时间】:2017-04-12 08:05:31
【问题描述】:
我有一个带有 webview 的 android 应用程序。点击 FB 或 Instagram 等外部链接时 - 打开新的 chrome 窗口。点击 Google+ 时 - 应用程序在 web 视图中打开。我想从包装器中打开 G+(已实现),但也想设法重定向到某个配置文件。 这是我的代码:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://plus.google.com/profile/posts"));
startActivity(intent);
上面的代码在我不希望它的包装器中打开 G+..
PackageManager pm = getPackageManager();
Intent launchIntent = pm.getLaunchIntentForPackage("com.google.android.apps.plus");
if (launchIntent != null) {
//intent.setClassName("com.google.android.apps.plus",
// "com.google.android.apps.plus.phone.UrlGatewayActivity");
launchIntent.putExtra("customAppUri",profile);
startActivity(launchIntent);}
上面的代码实际上是从包装器中打开 G+ 应用程序,但它没有重定向到个人资料页面。
有什么建议吗?
【问题讨论】:
标签: android webview google-plus