mardi 3 février 2015

clueless why app is get force closed on GoogleApiClient.connect()


Vote count:

0




the app force closes on calling GoogleApiClient.connect() method, atleast if it doesn't connect it should call onConnectionFailed, but dont know why my app is getting force closed. when i comment GoogleApiClient.connect() method it doesn't force close........ try from hours together .



package com.playservices.murali.playservices;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.games.Games;
import com.google.android.gms.plus.Plus;


public class MainActivity extends ActionBarActivity implements
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener {
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Games.API).addScope(Games.SCOPE_GAMES)
.addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN)
.build();
}

@Override
protected void onStart()
{
super.onStart();
mGoogleApiClient.connect();
}

protected void onStop()
{
super.onStop();
//mGoogleApiClient.disconnect();
}
@Override
public void onConnected(Bundle bundle) {

}

@Override
public void onConnectionSuspended(int i) {

}

@Override
public void onConnectionFailed(ConnectionResult connectionResult) {

}
}


the error message log for the android is below image enter image description here



asked 37 secs ago







clueless why app is get force closed on GoogleApiClient.connect()

Aucun commentaire:

Enregistrer un commentaire