Android Google Plus SDK: progress indicator (ProgressBar) never stops after click on +1 button

血红的双手。 提交于 2019-12-24 12:20:01

问题


I implemented the +1 button in my Android app. Almost everything works fine:

  • I can log in /log out
  • when I am logged in, the +1 button tells what is the number of +1 and becomes red/white in compliance with the fact that I did or not a +1 on my webpage

BUT....when I click on the +1 button, an activity indicator (progress indicator (ProgressBar)) appears on my +1 button (which becomes white) and it never stops rotating ! The window to cancel/share/make a +1 never appears...

Note that I have another activity with a +1 button in my app and that the +1 button in this other activity works perfectly well...

I don't understand what is the problem !

A ny idea ?

Thanks !


回答1:


Found the solution: I did have a listener like this on my PlusOneButton...:

PlusOneButton on Android how to know if user has clicked?

Very bad idea... It induces this bug !!

Don't use this listener ! If anybody has a solution to put a listener without inducing a bug, let me know ! I would like to track the number of clicks on this button...

Also, be sure that you are signed in (you have to include the code to sign in).




回答2:


try this.it has bug when user undo the +1 .

        mPlusButton.setOnPlusOneClickListener(new PlusOneButton.OnPlusOneClickListener() {
       @Override
       public void onPlusOneClick(Intent intent) {
         try {
            mConnectionResult.startResolutionForResult(HomeActivity.this, REQUEST_CODE_RESOLVE_ERR);
        } catch (SendIntentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

       }
   });


来源:https://stackoverflow.com/questions/19833038/android-google-plus-sdk-progress-indicator-progressbar-never-stops-after-clic

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