當前位置: 首頁>>代碼示例>>Java>>正文


Java SendIntentException.printStackTrace方法代碼示例

本文整理匯總了Java中android.content.IntentSender.SendIntentException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java SendIntentException.printStackTrace方法的具體用法?Java SendIntentException.printStackTrace怎麽用?Java SendIntentException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.IntentSender.SendIntentException的用法示例。


在下文中一共展示了SendIntentException.printStackTrace方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onClick

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onClick(View view) {
    if (view.getId() == R.id.sign_in_button && !mPlusClient.isConnected()) {
        if (mConnectionResult == null) {
        	mPlusClient.connect();
        	mProgress.setVisibility(View.VISIBLE);
        	
        } else {
            try {
                mConnectionResult.startResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR);
            } catch (SendIntentException e) {
                // Try connecting again.
            	e.printStackTrace();
                mConnectionResult = null;
                connectGPlus();
            }
        }
    }
}
 
開發者ID:DesenvolvedoresGoogle,項目名稱:Allow,代碼行數:20,代碼來源:LoginActivity.java

示例2: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(ConnectionResult result) {
	if (mProgress.getVisibility() == View.VISIBLE) {
		// The user clicked the sign-in button already. Start to resolve
		// connection errors. Wait until onConnected() to dismiss the
		// connection dialog.
		if (result.hasResolution()) {
			try {
				result.startResolutionForResult(this,
						REQUEST_CODE_RESOLVE_ERR);
			} catch (SendIntentException e) {
				e.printStackTrace();
				connectGPlus();
			}
		}
	}
	// Save the result and resolve the connection failure upon a user click.
	mConnectionResult = result;
}
 
開發者ID:DesenvolvedoresGoogle,項目名稱:Allow,代碼行數:20,代碼來源:LoginActivity.java

示例3: launchUserInteractionPendingIntent

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
public void launchUserInteractionPendingIntent(PendingIntent pendingIntent, int requestCode) {
    requestCode |= REQUEST_MASK_RECIPIENT_PRESENTER;
    try {
        startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, 0, 0, 0);
    } catch (SendIntentException e) {
        e.printStackTrace();
    }
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:9,代碼來源:MessageCompose.java

示例4: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
	// Turn off the request flag
       mInProgress = false;
       /*
        * If the error has a resolution, start a Google Play services
        * activity to resolve it.
        */
       if (connectionResult.hasResolution()) {
           try {
               connectionResult.startResolutionForResult(this, CONNECTION_FAILURE_RESOLUTION_REQUEST);
           } catch (SendIntentException e) {
               // Log the error
               e.printStackTrace();
           }
       // If no resolution is available, display an error dialog
       } else {
           // Get the error code
           int errorCode = connectionResult.getErrorCode();
           // Get the error dialog from Google Play services
           Dialog errorDialog = GooglePlayServicesUtil.getErrorDialog(
                   errorCode, this, CONNECTION_FAILURE_RESOLUTION_REQUEST);
           // If Google Play services can provide an error dialog
           if (errorDialog != null) {
               ErrorDialogFragment errorFragment =
                       new ErrorDialogFragment();
               errorFragment.setDialog(errorDialog);
               // Show the error dialog in the DialogFragment
               errorFragment.show(getSupportFragmentManager(), "Activity Recognition");
           }
       }
}
 
開發者ID:RobertTrebor,項目名稱:CycleFrankfurtAndroid,代碼行數:33,代碼來源:RecordingActivity.java

示例5: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(final ConnectionResult connectionResult) {

    // Turn off the request flag
    mInProgress = false;

    /*
     * Google Play services can resolve some errors it detects. If the error
     * has a resolution, try sending an Intent to start a Google Play
     * services activity that can resolve error.
     */
    if (connectionResult.hasResolution()) {

        try {
            // Start an Activity that tries to resolve the error
            connectionResult.startResolutionForResult((FragmentActivity) mContext,
                    GeofenceUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);

            /*
             * Thrown if Google Play services canceled the original
             * PendingIntent
             */
        } catch (SendIntentException e) {
            e.printStackTrace();
        }
    } else {
        mListener.errorGeofenceListener(mPlaceId, mContext.getString(R.string.geofences_add_fails));
    }
}
 
開發者ID:CesarValiente,項目名稱:GeofencesDemo,代碼行數:30,代碼來源:GeofenceRequester.java

示例6: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(final ConnectionResult connectionResult) {

    // A request is no longer in progress
    mInProgress = false;

    /*
     * Google Play services can resolve some errors it detects. If the error
     * has a resolution, try sending an Intent to start a Google Play
     * services activity that can resolve error.
     */
    if (connectionResult.hasResolution()) {

        try {
            // Start an Activity that tries to resolve the error
            connectionResult.startResolutionForResult((MainActivity) mContext,
                    GeofenceUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);

            /*
             * Thrown if Google Play services canceled the original
             * PendingIntent
             */
        } catch (SendIntentException e) {
            // Log the error
            e.printStackTrace();
        }

        /*
         * If no resolution is available, put the error code in an error
         * Intent and broadcast it back to the main Activity. The Activity
         * then displays an error dialog. is out of date.
         */
    } else {
        mListener.errorGeofenceListener(mPlaceId, mContext.getString(R.string.geofences_removed_fails));
    }
}
 
開發者ID:CesarValiente,項目名稱:GeofencesDemo,代碼行數:37,代碼來源:GeofenceRemover.java

示例7: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {

    // Turn off the request flag
    mInProgress = false;

    /*
     * Google Play services can resolve some errors it detects.
     * If the error has a resolution, try sending an Intent to
     * start a Google Play services activity that can resolve
     * error.
     */
    if (connectionResult.hasResolution()) {

        try {
            // Start an Activity that tries to resolve the error
            connectionResult.startResolutionForResult(mActivity,
                GeofenceUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);

        /*
         * Thrown if Google Play services canceled the original
         * PendingIntent
         */
        } catch (SendIntentException e) {
            // Log the error
            e.printStackTrace();
        }

    /*
     * If no resolution is available, put the error code in
     * an error Intent and broadcast it back to the main Activity.
     * The Activity then displays an error dialog.
     * is out of date.
     */
    } else {

        Intent errorBroadcastIntent = new Intent(GeofenceUtils.ACTION_CONNECTION_ERROR);
        errorBroadcastIntent.addCategory(GeofenceUtils.CATEGORY_LOCATION_SERVICES)
                            .putExtra(GeofenceUtils.EXTRA_CONNECTION_ERROR_CODE,
                                    connectionResult.getErrorCode());
        LocalBroadcastManager.getInstance(mActivity).sendBroadcast(errorBroadcastIntent);
    }
}
 
開發者ID:Preston-Landers,項目名稱:QuietPlaces,代碼行數:44,代碼來源:GeofenceRequester.java

示例8: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {

    // A request is no longer in progress
    mInProgress = false;

    /*
     * Google Play services can resolve some errors it detects.
     * If the error has a resolution, try sending an Intent to
     * start a Google Play services activity that can resolve
     * error.
     */
    if (connectionResult.hasResolution()) {

        try {
            // Start an Activity that tries to resolve the error
            connectionResult.startResolutionForResult((Activity) mContext,
                    GeofenceUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);

        /*
         * Thrown if Google Play services canceled the original
         * PendingIntent
         */
        } catch (SendIntentException e) {
            // Log the error
            e.printStackTrace();
        }

    /*
     * If no resolution is available, put the error code in
     * an error Intent and broadcast it back to the main Activity.
     * The Activity then displays an error dialog.
     * is out of date.
     */
    } else {

        Intent errorBroadcastIntent = new Intent(GeofenceUtils.ACTION_CONNECTION_ERROR);
        errorBroadcastIntent.addCategory(GeofenceUtils.CATEGORY_LOCATION_SERVICES)
                .putExtra(GeofenceUtils.EXTRA_CONNECTION_ERROR_CODE,
                        connectionResult.getErrorCode());
        LocalBroadcastManager.getInstance(mContext).sendBroadcast(errorBroadcastIntent);
    }
}
 
開發者ID:Preston-Landers,項目名稱:QuietPlaces,代碼行數:44,代碼來源:GeofenceRemover.java

示例9: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {

    // Turn off the request flag
    isInProgress = false;

    /*
     * Google Play services can resolve some errors it detects.
     * If the error has a resolution, try sending an Intent to
     * start a Google Play services activity that can resolve
     * error.
     */
    if (connectionResult.hasResolution()) {

        try {
            // Start an Activity that tries to resolve the error
            connectionResult.startResolutionForResult(activity,
                GeofenceUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);

        /*
         * Thrown if Google Play services canceled the original
         * PendingIntent
         */
        } catch (SendIntentException e) {
            // Log the error
            e.printStackTrace();
        }

    /*
     * If no resolution is available, put the error code in
     * an error Intent and broadcast it back to the main Activity.
     * The Activity then displays an error dialog.
     * is out of date.
     */
    } else {

        Intent errorBroadcastIntent = new Intent(GeofenceUtils.ACTION_CONNECTION_ERROR);
        errorBroadcastIntent.addCategory(GeofenceUtils.CATEGORY_LOCATION_SERVICES)
                            .putExtra(GeofenceUtils.EXTRA_CONNECTION_ERROR_CODE,
                                    connectionResult.getErrorCode());
        LocalBroadcastManager.getInstance(activity).sendBroadcast(errorBroadcastIntent);
    }
}
 
開發者ID:knr1,項目名稱:ch.bfh.mobicomp,代碼行數:44,代碼來源:GeofenceRequester.java

示例10: onConnectionFailed

import android.content.IntentSender.SendIntentException; //導入方法依賴的package包/類
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {

    // A request is no longer in progress
    isInProgress = false;

    /*
     * Google Play services can resolve some errors it detects.
     * If the error has a resolution, try sending an Intent to
     * start a Google Play services activity that can resolve
     * error.
     */
    if (connectionResult.hasResolution()) {

        try {
            // Start an Activity that tries to resolve the error
            connectionResult.startResolutionForResult((Activity) context,
                GeofenceUtils.CONNECTION_FAILURE_RESOLUTION_REQUEST);

        /*
         * Thrown if Google Play services canceled the original
         * PendingIntent
         */
        } catch (SendIntentException e) {
            // Log the error
            e.printStackTrace();
        }

    /*
     * If no resolution is available, put the error code in
     * an error Intent and broadcast it back to the main Activity.
     * The Activity then displays an error dialog.
     * is out of date.
     */
    } else {

        Intent errorBroadcastIntent = new Intent(GeofenceUtils.ACTION_CONNECTION_ERROR);
        errorBroadcastIntent.addCategory(GeofenceUtils.CATEGORY_LOCATION_SERVICES)
                            .putExtra(GeofenceUtils.EXTRA_CONNECTION_ERROR_CODE,
                                    connectionResult.getErrorCode());
        LocalBroadcastManager.getInstance(context).sendBroadcast(errorBroadcastIntent);
    }
}
 
開發者ID:knr1,項目名稱:ch.bfh.mobicomp,代碼行數:44,代碼來源:GeofenceRemover.java


注:本文中的android.content.IntentSender.SendIntentException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。