+1 点击在 Android 与 Google+ 的集成中不起作用 [英] +1 click is not working in Android integration with Google+

查看:34
本文介绍了+1 点击在 Android 与 Google+ 的集成中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照此链接在我的 Android 应用程序中使用 +1 按钮+1 链接或网站,但不幸的是它没有按预期工作,并且当我点击它时它没有响应.我尝试使用以下内容:

I followed this link to use the +1 button in my Android application to +1 a link or a website, but unfortunately it didn't work as expected and it didn't respond when I click on it. I tried to use the following:

   mPlusOneButton.setOnPlusOneClickListener(new OnPlusOneClickListener() {

        @Override
        public void onPlusOneClick(Intent arg0) {
            // TODO Auto-generated method stub
            startActivityForResult(arg0, 0);
        }
    });

但也没有反应.作为示例,我尝试使用以下代码行:

But also no response. As an example I tried to use the following line of code:

        mPlusOneButton.initialize(plusClient, "http://www.googleplustoday.net", PLUS_ONE_REQUEST_CODE);

而且我的 Google+ 个人资料中的 +1 标签没有任何影响.

And there is no effect on my Google plus profile at the +1 tab.

谁能帮忙?提前致谢.

推荐答案

确保连接到 Google Plus:

Make sure to be connected to Google Plus:

mPlusOneButton.setOnPlusOneClickListener(new OnPlusOneClickListener() {

    @Override
    public void onPlusOneClick(Intent intent) {
        if(!plusClient.isConnected()) {
            plusClient.connect();
        } else {
            startActivityForResult(intent, 0);
        }
    }

}

这篇关于+1 点击在 Android 与 Google+ 的集成中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆