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


Java ConnectionResult.SERVICE_DISABLED属性代码示例

本文整理汇总了Java中com.google.android.gms.common.ConnectionResult.SERVICE_DISABLED属性的典型用法代码示例。如果您正苦于以下问题:Java ConnectionResult.SERVICE_DISABLED属性的具体用法?Java ConnectionResult.SERVICE_DISABLED怎么用?Java ConnectionResult.SERVICE_DISABLED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.gms.common.ConnectionResult的用法示例。


在下文中一共展示了ConnectionResult.SERVICE_DISABLED属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkGooglePlayServices

public static boolean checkGooglePlayServices(final Activity activity) {
    final int googlePlayServicesCheck = GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity);
    switch (googlePlayServicesCheck) {
        case ConnectionResult.SUCCESS:
            return true;
        case ConnectionResult.SERVICE_DISABLED:
        case ConnectionResult.SERVICE_INVALID:
        case ConnectionResult.SERVICE_MISSING:
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            Dialog dialog = GooglePlayServicesUtil.getErrorDialog(googlePlayServicesCheck, activity, 0);
            dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                @Override
                public void onCancel(DialogInterface dialogInterface) {
                    activity.finish();
                }
            });
            dialog.show();
    }
    return false;
}
 
开发者ID:dreaminglion,项目名称:iosched-reader,代码行数:20,代码来源:PlayServicesUtils.java

示例2: checkPlayServices

private PlayServicesStatus checkPlayServices(Context context) {
  int gcmStatus = 0;

  try {
    gcmStatus = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context);
  } catch (Throwable t) {
    Log.w(TAG, t);
    return PlayServicesStatus.MISSING;
  }

  Log.w(TAG, "Play Services: " + gcmStatus);

  switch (gcmStatus) {
    case ConnectionResult.SUCCESS:
      return PlayServicesStatus.SUCCESS;
    case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
      return PlayServicesStatus.NEEDS_UPDATE;
    case ConnectionResult.SERVICE_DISABLED:
    case ConnectionResult.SERVICE_MISSING:
    case ConnectionResult.SERVICE_INVALID:
    case ConnectionResult.API_UNAVAILABLE:
    case ConnectionResult.SERVICE_MISSING_PERMISSION:
      return PlayServicesStatus.MISSING;
    default:
      return PlayServicesStatus.TRANSIENT_ERROR;
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:27,代码来源:RegistrationActivity.java

示例3: errorCodeToString

static String errorCodeToString(int errorCode) {
    switch (errorCode) {
        case ConnectionResult.DEVELOPER_ERROR:
            return "DEVELOPER_ERROR(" + errorCode + ")";
        case ConnectionResult.INTERNAL_ERROR:
            return "INTERNAL_ERROR(" + errorCode + ")";
        case ConnectionResult.INVALID_ACCOUNT:
            return "INVALID_ACCOUNT(" + errorCode + ")";
        case ConnectionResult.LICENSE_CHECK_FAILED:
            return "LICENSE_CHECK_FAILED(" + errorCode + ")";
        case ConnectionResult.NETWORK_ERROR:
            return "NETWORK_ERROR(" + errorCode + ")";
        case ConnectionResult.RESOLUTION_REQUIRED:
            return "RESOLUTION_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SERVICE_DISABLED:
            return "SERVICE_DISABLED(" + errorCode + ")";
        case ConnectionResult.SERVICE_INVALID:
            return "SERVICE_INVALID(" + errorCode + ")";
        case ConnectionResult.SERVICE_MISSING:
            return "SERVICE_MISSING(" + errorCode + ")";
        case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
            return "SERVICE_VERSION_UPDATE_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SIGN_IN_REQUIRED:
            return "SIGN_IN_REQUIRED(" + errorCode + ")";
        case ConnectionResult.SUCCESS:
            return "SUCCESS(" + errorCode + ")";
        default:
            return "Unknown error code " + errorCode;
    }
}
 
开发者ID:AndreFCruz,项目名称:feup-lpoo-armadillo,代码行数:30,代码来源:GameHelperUtils.java

示例4: isGooglePlayServicesUpdateRequiredError

/**
 * @param errorCode returned by {@link #checkGooglePlayServicesAvailable(Context)}.
 * @return true if the error code indicates that an invalid version of Google Play Services is
 *         installed.
 */
public boolean isGooglePlayServicesUpdateRequiredError(int errorCode) {
    return errorCode == ConnectionResult.SERVICE_UPDATING
            || errorCode == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED
            || errorCode == ConnectionResult.SERVICE_DISABLED
            || errorCode == ConnectionResult.SERVICE_MISSING;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:11,代码来源:ExternalAuthUtils.java


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