Created
March 1, 2015 08:36
-
-
Save muratcanbur/2a6a2b150893454e7be5 to your computer and use it in GitHub Desktop.
method to verify google play services on the device
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* verify google play services on the device | |
* */ | |
private boolean checkPlayServices() { | |
int resultCode = GooglePlayServicesUtil | |
.isGooglePlayServicesAvailable(this); | |
if (resultCode != ConnectionResult.SUCCESS) { | |
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) { | |
GooglePlayServicesUtil.getErrorDialog(resultCode, this, | |
PLAY_SERVICES_RESOLUTION_REQUEST).show(); | |
} else { | |
Toast.makeText(getApplicationContext(), | |
"This device is not supported.", Toast.LENGTH_LONG) | |
.show(); | |
finish(); | |
} | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment