本文整理汇总了Java中com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException类的典型用法代码示例。如果您正苦于以下问题:Java GooglePlayServicesAvailabilityIOException类的具体用法?Java GooglePlayServicesAvailabilityIOException怎么用?Java GooglePlayServicesAvailabilityIOException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GooglePlayServicesAvailabilityIOException类属于com.google.api.client.googleapis.extensions.android.gms.auth包,在下文中一共展示了GooglePlayServicesAvailabilityIOException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
context.hideLoadingScreen();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
context.startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
REQUEST_AUTHORIZATION);
} else {
context.showError("The following error occurred:\n"
+ mLastError.getMessage(),context);
}
} else {
context.showError("Request cancelled.",context);
}
}
示例2: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
context.hideLoadingScreen();
context.enableFields();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
context.startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
REQUEST_AUTHORIZATION);
} else {
context.showError("The following error occurred:\n"
+ mLastError.getMessage(),context);
}
} else {
context.showError("Request cancelled.",context);
}
}
示例3: onAsyncTaskCancel
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
public void onAsyncTaskCancel(Exception mLastError) {
mProgress.hide();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
REQUEST_AUTHORIZATION);
} else {
mOutputText.setTextColor(ContextCompat.getColor(getContext(), RED_WARN_COLOR));
if (mLastError instanceof GoogleAuthIOException) {
Log.e(LOG_TAG,"Authentication error occured when calling Google Drive API.", mLastError);
mOutputText.setText(R.string.googleDrive_authErr);
} else {
mOutputText.setText(getString(R.string.googleDrive_errOccurred, mLastError.getMessage()));
}
}
} else {
mOutputText.setTextColor(ContextCompat.getColor(getContext(), RED_WARN_COLOR));
mOutputText.setText(R.string.googleDrive_cancelledRequest);
}
}
示例4: onAsyncTaskCancel
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
public void onAsyncTaskCancel(Exception mLastError) {
Log.e(LOG_TAG, "async error");
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
REQUEST_AUTHORIZATION);
} else {
if (mLastError instanceof GoogleAuthIOException) {
Log.e(LOG_TAG,"Authentication error occured when calling Google Drive API.", mLastError);
txtStatus.setText(R.string.googleDrive_authErr);
} else {
txtStatus.setText(getString(R.string.googleDrive_errOccurred, mLastError.getMessage()));
}
}
} else {
txtStatus.setText(R.string.googleDrive_cancelledRequest);
}
}
示例5: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
mProgress.hide();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
CheckupReminders.REQUEST_AUTHORIZATION);
} else {
//mOutputText.setText("The following error occurred:\n"+ mLastError.getMessage());
}
} else {
// mOutputText.setText("Request cancelled.");
}
}
示例6: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
mProgress.hide();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
ClockActivity.REQUEST_AUTHORIZATION);
} else {
Toast.makeText(ClockActivity.this,"The following error occurred:\n"
+ mLastError.getMessage(),Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(ClockActivity.this,"Request cancelled.",Toast.LENGTH_SHORT).show();
}
}
示例7: onAndiCarTaskCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
public void onAndiCarTaskCancelled(String errorMsg, Exception e) {
if (mProgress != null) {
mProgress.dismiss();
}
if (e != null) {
if (e instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) e).getConnectionStatusCode());
} else if (e instanceof UserRecoverableAuthIOException) {
getActivity().startActivityForResult(
((UserRecoverableAuthIOException) e).getIntent(), ConstantValues.REQUEST_GMAIL_AUTHORIZATION);
} else {
Utils.showReportableErrorDialog(getActivity(), errorMsg, null, e);
Log.d("SendGMailTask", "The following error occurred:\n" + e.getMessage(), e);
}
} else {
Utils.showNotReportableErrorDialog(getActivity(), errorMsg, null);
Log.d("SendGMailTask", "Request cancelled: " + errorMsg);
}
}
示例8: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
mProgress.hide();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
GoogleBackup.REQUEST_AUTHORIZATION);
} else {
mOutputText.setText("The following error occurred:\n"
+ mLastError.getMessage());
}
} else {
mOutputText.setText("Request cancelled.");
}
}
示例9: onCalendarUpdateError
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
public void onCalendarUpdateError(Exception error)
{
if (error != null)
{
if (error instanceof GooglePlayServicesAvailabilityIOException)
{
final int code = ((GooglePlayServicesAvailabilityIOException) error)
.getConnectionStatusCode();
showGooglePlayServicesAvailabilityErrorDialog(code);
}
else if (error instanceof UserRecoverableAuthIOException)
{
startActivityForResult(((UserRecoverableAuthIOException) error).getIntent(),
REQUEST_AUTHORIZATION);
}
else
{
showMessage("An error occurred. If the problem persists, please contact ICB");
}
}
else
{
showMessage("Request Cancelled");
}
}
示例10: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
mProgress.dismiss();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
1001);
} else {
//mOutputText.setText("The following error occurred:\n"
//+ mLastError.getMessage());
}
} else {
//mOutputText.setText("Request cancelled.");
}
}
示例11: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
mProgress.hide();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
} else if (mLastError instanceof UserRecoverableAuthIOException) {
startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
Utils.REQUEST_AUTHORIZATION);
} else {
showMessage(view, "The following error occurred:\n" + mLastError);
Log.v("Error", mLastError + "");
}
} else {
showMessage(view, "Request Cancelled.");
}
}
示例12: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
//Need to complete credentials (ack from user first time)
if (mLastError instanceof UserRecoverableAuthIOException) {
DashboardActivity.dashboardActivity.startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
DriveRestControllerStrategy.REQUEST_AUTHORIZATION);
return;
}
//Real connection google error
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
DriveRestControllerStrategy.getInstance().showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
return;
}
//Other error
Log.e(TAG, "onCancelled: " + mLastError == null ? "" : mLastError.getMessage());
}
示例13: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
//Need to complete credentials (ack from user first time)
if (mLastError instanceof UserRecoverableAuthIOException) {
DashboardActivity.dashboardActivity.startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
DriveRestController.REQUEST_AUTHORIZATION);
return;
}
//Real connection google error
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
DriveRestController.getInstance().showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode());
return;
}
//Other error
Log.e(TAG, "onCancelled: " + mLastError == null ? "" : mLastError.getMessage());
}
示例14: doInBackground
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
/**
* Background task to call Google Calendar API.
* @param params no parameters needed for this task.
*/
@Override
protected Void doInBackground(Void... params) {
try {
mActivity.clearResultsText();
mActivity.updateResultsText(getDataFromApi());
} catch (final GooglePlayServicesAvailabilityIOException availabilityException) {
mActivity.showGooglePlayServicesAvailabilityErrorDialog(
availabilityException.getConnectionStatusCode());
} catch (UserRecoverableAuthIOException userRecoverableException) {
mActivity.startActivityForResult(
userRecoverableException.getIntent(),
MainActivity.REQUEST_AUTHORIZATION);
} catch (IOException e) {
mActivity.updateStatus("The following error occurred: " +
e.getMessage());
}
return null;
}
示例15: onCancelled
import com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException; //导入依赖的package包/类
@Override
protected void onCancelled() {
mProgress.hide();
if (mLastError != null) {
if (mLastError instanceof GooglePlayServicesAvailabilityIOException) {
AuthManager.showGooglePlayServicesAvailabilityErrorDialog(
((GooglePlayServicesAvailabilityIOException) mLastError)
.getConnectionStatusCode(), mActivity);
} else if (mLastError instanceof UserRecoverableAuthIOException) {
AuthManager.setAuthReason(AuthManager.CREATING);
mActivity.startActivityForResult(
((UserRecoverableAuthIOException) mLastError).getIntent(),
AuthManager.REQUEST_AUTHORIZATION);
} else {
String errorMsg = mActivity.getString(R.string.sheet_create_error) + mLastError.getMessage();
Toast.makeText(mActivity, errorMsg, Toast.LENGTH_SHORT).show();
}
} else {
Toast.makeText(mActivity, R.string.sheet_create_cancel, Toast.LENGTH_SHORT).show();
}
}