【发布时间】:2014-03-26 07:40:11
【问题描述】:
我正在构建一个 android 应用程序(基于 Google Drive Services)。我已经按照这个Google Drive Service for Android link 来构建我的应用程序。我做对了每一件事。现在,当我运行该应用程序时,它会显示提示消息 “Google Play 服务的未知问题” Google Play Services 也安装在我的手机上(版本:2.3.4 Ginger bred)。
注意:我以编程方式检查了 Google Play 服务,它说 Goolge 播放服务运行良好,但我仍然收到提示消息中的错误。
//Checking GooglePlayServices working
int isAvailable = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (isAvailable == ConnectionResult.SUCCESS)
{
Toast.makeText(this, "Google play services is working well...!", Toast.LENGTH_SHORT).show();
}
else if (GooglePlayServicesUtil.isUserRecoverableError(isAvailable))
{
int RESOLVE_CONNECTION_REQUEST_CODE= 0;
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(isAvailable, this,RESOLVE_CONNECTION_REQUEST_CODE);
dialog.show();
}
else
Toast.makeText(this, "Can't connect to google play services.", Toast.LENGTH_SHORT).show();
实际上 connectionResult.hasResolution() 没有返回真实值。我在此代码中收到提示错误消息:
if (connectionResult.hasResolution())
{
//My essential code
}
else
{
GooglePlayServicesUtil.getErrorDialog(connectionResult.getErrorCode(), this, 0).show();
}
【问题讨论】:
标签: android google-play-services