+1 click is not working in Android integration with Google+

懵懂的女人 提交于 2019-12-06 07:26:02

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

}

Be sure that you initialize your mPlusOneButton prior to handling clicks such as in the onResume method. When I tested by not initializing before the click then I could get it to fail.

In the androidsdk/extras/google/google_play_services/samples/plus/src/com/google/android/gms/samples/plus/PlusOneActivity.java contains a skeleton activity for getting the PlusOne button working.

If you can post your full activity code and any applicable errors from logcat that would help further identify the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!