问题
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