当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Google Plus Api: Plus.PeopleApi.loadVisible(.).setResultCallback(this) not calling back

问题描述:

I am trying to use the following example but I can't get the callback to fire:

https://developers.google.com/+/mobile/android/people

If I have a connected GoogleApiClient I try

if(mGoogleApiClient.hasConnectedApi(Plus.API)) {

Plus.PeopleApi.loadVisible(mGoogleApiClient, null).setResultCallback(this);

}

Callback is:

@Override

public void onResult(@NonNull People.LoadPeopleResult result) {

if (result.getStatus().getStatusCode() == CommonStatusCodes.SUCCESS) {

PersonBuffer personBuffer = result.getPersonBuffer();

try {

mListener.onNumberFollowers(personBuffer.getCount());

} finally {

personBuffer.release();

}

} else {

mListener.onNumberFollowers(0);

}

mListener = null;

}

but the callback never gets called. Unlike the example, this happens in a helper class rather than an activity but I don't see whay that should matter.

I would very grateful if anyone can spot what I am doing wrong...

Many thanks,

Riz

分享给朋友:
您可能感兴趣的文章:
随机阅读: