Android ConnectionResult - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ConnectionResult class.

This code example shows how to use the following methods: getErrorCode, hasResolution, startResolutionForResult
     * necessary for sign-in to work. 
     */ 
    void resolveConnectionResult() { 
        // Try to resolve the problem 
        debugLog("resolveConnectionResult: trying to resolve result: " + mConnectionResult);
        if (mConnectionResult.hasResolution()) {
            // This problem can be fixed. So let's try to fix it. 
            debugLog("result has resolution. Starting it."); 
            try { 
                // launch appropriate UI flow (which might, for example, be the 
                // sign-in flow) 
                mExpectingActivityResult = true;
                mConnectionResult.startResolutionForResult(mActivity, RC_RESOLVE);
            } catch (SendIntentException e) {
                // Try connecting again 
                debugLog("SendIntentException."); 
                connectCurrentClient(); 
            } 
        } else { 
            // It's not a problem what we can solve, so give up and show an 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getErrorCode, hasResolution, startResolutionForResult
 
    /** 
     * Perform resolution given a non-null result. 
     */ 
    private void resolveLastResult() { 
        if (GooglePlayServicesUtil.isUserRecoverableError(mLastConnectionResult.getErrorCode())) {
        	// Show a dialog to install or enable Google Play services. 
        	showErrorDialog(ErrorDialogFragment.create(mLastConnectionResult.getErrorCode(),
        			mRequestCode));
            return; 
        } 
 
        if (mLastConnectionResult.hasResolution()) {
            startResolution(); 
        } 
    } 
     
    public static final class ErrorDialogFragment extends GooglePlayServicesErrorDialogFragment { 
 
        public static ErrorDialogFragment create(int errorCode, int requestCode) {

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getErrorCode, toString
		mLocationClient.disconnect();
	} 
 
	@Override 
	public void onConnectionFailed(ConnectionResult arg0) {
		Log.w(LOG,"location connect failed: " + arg0.getErrorCode() + "=" + arg0.toString());
		 
	} 
 
	@Override 
	public void onConnected(Bundle arg0) {
		 
 
		mLocationRequest = LocationRequest.create();
 
		mLocationRequest.setInterval(Geo.LOG_RATE);
 
		mLocationClient.requestLocationUpdates(mLocationRequest, this);
		 
	} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getErrorCode, hasResolution
    } 
     
    void resolveConnectionResult() { 
        // Try to resolve the problem 
        debugLog("resolveConnectionResult: trying to resolve result: " + mConnectionResult);
        if (mConnectionResult.hasResolution()) {
            // This problem can be fixed. So let's try to fix it. 
            debugLog("result has resolution. Starting it."); 
            try { 
                // launch appropriate UI flow (which might, for example, be the 
                // sign-in flow) 
                mExpectingActivityResult = true;
                debugLog("Resolving intent with activity "+mParentActivity);
                // create dummy activity 
                /*mDummyActivity = new DummyActivity(); 
                Intent intent = new Intent(); 
                mDummyActivity.startActivity(intent);*/ 
                 
                Intent intent = new Intent(mParentActivity, DummyActivity.class);
    			intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getErrorCode, hasResolution, startResolutionForResult
     * flow that lets the user give the appropriate consents necessary for sign-in to work. 
     */ 
    void resolveConnectionResult() { 
        // Try to resolve the problem 
        debugLog("resolveConnectionResult: trying to resolve result: " + mConnectionResult);
        if (mConnectionResult.hasResolution()) {
            // This problem can be fixed. So let's try to fix it. 
            debugLog("result has resolution. Starting it."); 
            try { 
                // launch appropriate UI flow (which might, for example, be the sign-in flow) 
                mExpectingActivityResult = true;
                mConnectionResult.startResolutionForResult(mActivity, RC_RESOLVE);
            } catch (SendIntentException e) {
                // Try connecting again 
                debugLog("SendIntentException."); 
                connectCurrentClient(); 
            } 
        } 
        else { 
            // It's not a problem what we can solve, so give up and show an error. 

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ConnectionResult Questions & Answers:

Other Android ConnectionResult Examples

1:		public void onConnectionFailed(ConnectionResult result) {
2:			if (!result.hasResolution()) {
3:				GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(), this,

Read More

30:		private boolean mSignInClicked;
31:	
32:		private ConnectionResult mConnectionResult;
33:	
34:		private SignInButton btnSignIn;

Read More

51:		private boolean mSignInClicked;
52:	
53:		private ConnectionResult mConnectionResult;
54:	
55:		private SignInButton btnSignIn;
-
111:	
112:		@Override
113:		public void onConnectionFailed(ConnectionResult result) {
114:			if (!result.hasResolution()) {
115:				GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(), this,

Read More

See Code Examples for Android ConnectionResult Methods: