Skip to content

Instantly share code, notes, and snippets.

@eufelipe
Last active June 17, 2017 18:19
Show Gist options
  • Save eufelipe/db2498e8b3c7cdbd0c4643e318988849 to your computer and use it in GitHub Desktop.
Save eufelipe/db2498e8b3c7cdbd0c4643e318988849 to your computer and use it in GitHub Desktop.
private boolean checkPlayServices() {
GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
if (apiAvailability.isUserResolvableError(resultCode)) {
apiAvailability.getErrorDialog(this, resultCode,
PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
Log.i(LOG_TAG, "This device is not supported.");
finish();
}
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment