本文介绍了Android的8或更高版本:检查谷歌播放服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此方法回头率0据开发文档此方法应该返回类似SUCCES如果该设备得到了谷歌最新版本的播放。是否有人知道如何使用它?
@覆盖
公共无效onResume(){
super.onResume();
GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
的System.out.println(henkie:+ GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()));
}
解决方案
它返回成功
。该文档明确指出,该方法有一个int返回类型,并返回一个
要检查什么返回,使用这样的:
INT状态= GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
如果(状态== ConnectionResult.SUCCESS){
//成功!做你要做的
}
this method keep returning 0. According to the developer docs this method should return something like SUCCES if the device got the newest version of google play. Does anybody know how to use this?
@Override
public void onResume() {
super.onResume();
GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
System.out.println("henkie: " + GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()));
}
解决方案
It is returning SUCCESS
. The documentation clearly states that the method had an int return type, and returns a
To check against what was returned, use something like:
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
if(status == ConnectionResult.SUCCESS) {
//Success! Do what you want
}
这篇关于Android的8或更高版本:检查谷歌播放服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!