当前位置: 首页>>代码示例>>Java>>正文


Java GooglePlayServicesAvailabilityIOException类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:Pl4gue,项目名称:homeworkManager-android,代码行数:21,代码来源:GetHomeworkPresenter.java

示例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);
    }
}
 
开发者ID:Pl4gue,项目名称:homeworkManager-android,代码行数:22,代码来源:AddHomeworkPresenter.java

示例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);
    }
}
 
开发者ID:piskula,项目名称:FuelUp,代码行数:27,代码来源:BackupFragment.java

示例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);
    }
}
 
开发者ID:piskula,项目名称:FuelUp,代码行数:25,代码来源:CheckPermissionsActivity.java

示例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.");
    }
}
 
开发者ID:webianks,项目名称:Crimson,代码行数:20,代码来源:CheckupReminders.java

示例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();

    }
}
 
开发者ID:jcolladosp,项目名称:ePills,代码行数:22,代码来源:ClockActivity.java

示例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);
    }

}
 
开发者ID:mkeresztes,项目名称:AndiCar,代码行数:23,代码来源:PreferenceActivity.java

示例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.");
    }
}
 
开发者ID:JonathanImperato,项目名称:Service-Notes,代码行数:21,代码来源:GoogleBackup.java

示例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");
    }
}
 
开发者ID:amrabed,项目名称:Iqama,代码行数:27,代码来源:Main.java

示例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.");
    }
}
 
开发者ID:ThisChessPlayer,项目名称:GroupScheduleCoordinator,代码行数:21,代码来源:MainActivity.java

示例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.");
    }
}
 
开发者ID:androidmads,项目名称:JavaMailwithGmailApi,代码行数:21,代码来源:MainActivity.java

示例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());
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:23,代码来源:DownloadMediaTask.java

示例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());
}
 
开发者ID:EyeSeeTea,项目名称:malariapp,代码行数:23,代码来源:DownloadMediaTask.java

示例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;
}
 
开发者ID:miguelarauj1o,项目名称:CalendarQuickStart,代码行数:26,代码来源:ApiAsyncTask.java

示例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();
    }
}
 
开发者ID:ACLay,项目名称:TATupload,代码行数:22,代码来源:MakeSheetTask.java


注:本文中的com.google.api.client.googleapis.extensions.android.gms.auth.GooglePlayServicesAvailabilityIOException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。