Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android google plus在webview内部打开,而不是从包装器中打开_Android_Webview_Google Plus - Fatal编程技术网

Android google plus在webview内部打开,而不是从包装器中打开

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"));

我有一个带有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")); 
 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);}