/**
* Check the device to make sure it has the Google Play Services APK. If
* it doesn't, display a dialog that allows users to download the APK from
* the Google Play Store or enable it in the device's system settings.
*/
public static boolean checkPlayServices(AppCompatActivity activity, int PLAY_SERVICES_RESOLUTION_REQUEST) {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = apiAvailability.isGooglePlayServicesAvailable(activity);
if (resultCode != ConnectionResult.SUCCESS) {
if (apiAvailability.isUserResolvableError(resultCode)) {
apiAvailability.getErrorDialog(activity, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST)
.show();
} else {
MaterialDialog dialog = new MaterialDialog.Builder(activity)
.content("This device is not supported.")
.show();
}
return false;
}
return true;
}
PlayServicesUtils.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:MyAnimeViewer
作者:
评论列表
文章目录