خرید بک لینک

Vote count: 0

I am working with an app in android studio, and when I try to coect to Google Api Client, it does not work.

private GoogleApiClient mGoogleApiClient;


protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_blank);
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addCoectionCallbacks(this)
            .addOnCoectionFailedListener(this)
            .addApi(Games.API).addScope(Games.SCOPE_GAMES)
            .build();
            // add other APIs and scopes here as needed

    Log.i("app", "onCreateCoection");
    //super.onStart();
    //mGoogleApiClient.coect();

    if (mGoogleApiClient != null) {
        Log.i("app", "mGoogleApiClient!=null");
    }
}

I know for sure mGoogleApiClient is not null because the Log.i (... !=null...) is printed. When I try to coect elsewhere in the code by using mGoogleApiClient.coect(); it fails and calls onCoectionFailed as seen below.

public void onCoectionFailed(CoectionResult result) {
    // We tried to coect but failed!
    Log.i("app", "coectionfailed");
    Log.i("app",result.toString());
}

Log.i, from the result.toString(), provides me: "CoectionResult{statusCode=RESOLUTION_REQUIRED, resolution=PendingIntent{f5af9e6: android.os.BinderProxy@72d054b}, message=null}"

As far I as read, it seems that I may need have a Google Play Service Developer, but since it cost cash I would know that this error is done by another issues or done because I need a Google Play Service Developer account.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 23 خرداد 1395 ساعت: 17:30

صفحه بندی