I used official tutorial to add google plus one button to one of my android apps. But plus one button shows wrong count. Everything i did in the code is the same as with the tutorial. I used it before never got this stupid error. Right now my app has been recommended 26 times so plus one button shoud show count as "26" but it shows "13".
To include plus button in my layout i used :
<com.google.android.gms.plus.PlusOneButton
android:id="@+id/plus_one_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/drawer_list_item_padding_left"
plus:annotation="inline"
plus:size="standard"
android:layout_marginBottom="@dimen/drawer_textview_paddingtopbottom"
android:layout_marginTop="@dimen/drawer_textview_paddingtopbottom" />
To assign button to a member variable i used :
mPlusOneButton = (PlusOneButton) findViewById(R.id.plus_one_button);
As suggested i initialized it in onResume method of my activity using below code :
mPlusOneButton.initialize(APP_URL, PLUS_ONE_REQUEST_CODE);
here APP_URL is my app's google play page url, PLUS_ONE_REQUEST_CODE is the activity request code i used it as 0.
Any suggestions? Thanks in advance.
in my case, after some days it showed correct g+ count itself. I didn't make any changes in my code because i was sure my code is right according to documentation. Why i got that annoying delay? I don't know, maybe it was related with google servers and updates.
I used it before never got this stupid error
--> Please post the code that yields the wrong result. If it worked the first time, it's possible that you are doing something wrong, that's making it yield incorrect results. – EzequielPlusOneButton
in your layout file does not have this line -->xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus"
. Could you add it and see if it makes any difference? – Ezequiel