Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.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中:共享时安装应用程序_Android_Api_Android Intent_Google Plus_Sharing - Fatal编程技术网

谷歌+;在Android中:共享时安装应用程序

谷歌+;在Android中:共享时安装应用程序,android,api,android-intent,google-plus,sharing,Android,Api,Android Intent,Google Plus,Sharing,我试图让我的应用程序在Google+中共享某些代码,当用户安装了官方的Google+应用程序时,它可以正常工作。 然而,当它没有安装时,根据文档,应该有一个弹出窗口告诉用户他/她没有安装应用程序,当点击按钮时,应用程序应该重定向到Google Play以便下载。。但是当点击按钮时,什么也没发生 有什么想法吗? 这是我的按钮代码: plus.setOnClickListener(new OnClickListener() { @Override pu

我试图让我的应用程序在Google+中共享某些代码,当用户安装了官方的Google+应用程序时,它可以正常工作。 然而,当它没有安装时,根据文档,应该有一个弹出窗口告诉用户他/她没有安装应用程序,当点击按钮时,应用程序应该重定向到Google Play以便下载。。但是当点击按钮时,什么也没发生

有什么想法吗? 这是我的按钮代码:

plus.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                shareDialog.dismiss();
                // Launch the Google+ share dialog with attribution to your app.
                Intent shareIntent = ShareCompat.IntentBuilder.from(getActivity()).setType("text/plain").setText("Welcome to the Google+ platform. https://developers.google.com/+").getIntent()
                        .setPackage("com.google.android.apps.plus");

                int errorCode = GooglePlusUtil.checkGooglePlusApp(getActivity());
                if (errorCode != GooglePlusUtil.SUCCESS) {
                    GooglePlusUtil.getErrorDialog(errorCode, getActivity(), 1).show();
                } else {
                    startActivity(shareIntent);
                }
            }
        });

提前多谢

新手错误:代替
GooglePlusUtil.getErrorDialog(errorCode,getActivity(),1.show()使用
GooglePlusUtil.getErrorDialog(错误代码,getActivity(),GooglePlusUtil.APP_缺失)。显示()