Example usage for android.content IntentSender.SendIntentException toString

List of usage examples for android.content IntentSender.SendIntentException toString

Introduction

In this page you can find the example usage for android.content IntentSender.SendIntentException toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:com.example.vasuchand.feedgen.youtubefetch.UploadsListFragment.java

@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
    if (connectionResult.hasResolution()) {
        Toast.makeText(getActivity(), R.string.connection_to_google_play_failed, Toast.LENGTH_SHORT).show();

        Log.e(TAG, String.format("Connection to Play Services Failed, error: %d, reason: %s",
                connectionResult.getErrorCode(), connectionResult.toString()));
        try {/*from   w  w  w  .j a v a2s  . c o m*/
            connectionResult.startResolutionForResult(getActivity(), 0);
        } catch (IntentSender.SendIntentException e) {
            Log.e(TAG, e.toString(), e);
        }
    }
}

From source file:com.klaasnotfound.locationassistant.LocationAssistant.java

/**
 * Brings up an in-app system dialog that requests a change in location provider settings.
 * The settings change may involve switching on GPS and/or network providers and depends on the accuracy and
 * update interval that was requested when constructing the LocationAssistant.
 * Call this method only from within {@link Listener#onNeedLocationSettingsChange()}.
 *///from   w  w w. ja v a  2 s  .c o  m
public void changeLocationSettings() {
    if (locationStatus == null)
        return;
    if (activity == null) {
        if (!quiet)
            Log.e(getClass().getSimpleName(),
                    "Need to resolve location status issues, but no activity is "
                            + "registered! Specify a valid activity when constructing "
                            + getClass().getSimpleName() + " or register it explicitly with register().");
        return;
    }
    try {
        locationStatus.startResolutionForResult(activity, REQUEST_CHECK_SETTINGS);
    } catch (IntentSender.SendIntentException e) {
        if (!quiet)
            Log.e(getClass().getSimpleName(),
                    "Error while attempting to resolve location status issues:\n" + e.toString());
        if (listener != null)
            listener.onError(ErrorType.SETTINGS,
                    "Could not resolve location settings issue:\n" + e.getMessage());
        changeSettings = false;
        acquireLocation();
    }
}