Code example for ConnectionResult

Methods: getErrorCodehasResolutionstartResolutionForResulthashCode

	 * .android.gms.common.ConnectionResult) 
	public void onConnectionFailed(ConnectionResult result) {
				"onConnectionFailed " + result + " hasResolution: " + result.hashCode() + " errorCode: "
						+ result.getErrorCode());
		// You can just set the mConnectionResult for your user to be able to connect using the signInButton 
		// @see gPlusSignInClicked() 
		if (!connectionAskedByUser) {
			// This case is when you want your user to click the g+connection button to connect 
			// and not hide it by an automatic connection 
			mConnectionResult = result;
		} else { 
			// Or you want to automagicly display him the solution to its problem either by showing the native SignIn 
			// Activity or the createAccount one. It's handle by the google team throught the GoogleService Api 
			try { 
				// if auto-connection failed then ensure to display the SignIn Activity to the user for him to be able 
				// to sign in if it's a Sign_In_Required else just try to find a solution 
				if (result.hasResolution()) {
					result.startResolutionForResult(this, requestCodeResolverError);
			} catch (SendIntentException e) {
				Log.e(TAG, "onConnectionFailed " + result, e);
			} finally { 
				connectionAskedByUser = false;
Connect your IDE to all the code out there  Get Codota for Java