当前位置: 首页>>代码示例>>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;未经允许,请勿转载。