Android google plus在webview内部打开,而不是从包装器中打开
我有一个带有webview的android应用程序。当点击FB或Instagram等外部链接时,新的chrome窗口将打开。当点击Google+时,应用程序将在webview中打开。我想从包装器中打开G+(已实现),但也要设法重定向到某个配置文件。 这是我的代码:Android google plus在webview内部打开,而不是从包装器中打开,android,webview,google-plus,Android,Webview,Google Plus,我有一个带有webview的android应用程序。当点击FB或Instagram等外部链接时,新的chrome窗口将打开。当点击Google+时,应用程序将在webview中打开。我想从包装器中打开G+(已实现),但也要设法重定向到某个配置文件。 这是我的代码: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("https://plus.google.com/profile/posts"));
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+应用程序,但它没有重定向到概要文件页面
有什么建议吗?G+将他们的活动名称改为“com.google.android.libraries.social.gateway.GatewayActivity”。相应的更新,它的工作完美 更新代码:
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.libraries.social.gateway.GatewayActivity");
launchIntent.putExtra("customAppUri",profile);
startActivity(launchIntent);}