该方法保持返回0.根据开发者文档,如果设备获得最新版本的Google Play,此方法应该返回类似SUCCES的方法.有人知道如何使用这个吗?
@Override public void onResume() { super.onResume(); GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); System.out.println("henkie: " + GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext())); }
解决方法
它正在返回成功.
documentation清楚地表示该方法有一个int返回类型,并返回一个
status code indicating whether there was an error. Can be one of
following in ConnectionResult: SUCCESS,SERVICE_MISSING,
SERVICE_VERSION_UPDATE_required,SERVICE_DISABLED,SERVICE_INVALID.
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()); if(status == ConnectionResult.SUCCESS) { //Success! Do what you want }