它让我疯狂在谷歌文档中经常忽略的重要文档。如果我不是秃头的话,我会拔掉我的头发。检查谷歌播放服务
private void checkGooglePlayServices() {
int errorCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this);
boolean isErrorResolvable = GoogleApiAvailability.getInstance().isUserResolvableError(errorCode);
if (isErrorResolvable) {
GoogleApiAvailability.getInstance().getErrorDialog(this, errorCode, REQUEST_CODE_GOOGLE_PLAY_SERVICES).show();
} else {
if (errorCode == ConnectionResult.SUCCESS) {
launchApplication();
}
}
}
上面的代码显示一个对话框,说有一个按钮阅读获取谷歌播放服务:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_GOOGLE_PLAY_SERVICES) {
}
}
现在我该怎么办吗?我应该如何引导用户到Play商店获取游戏服务的更新?我认为 getErrorResolutionPendingIntent
在这里有用,但我不知道如何去做这件事。
请帮助我。
谢谢。这让我很困扰。 –