按照本教程,我将此代码粘贴到我的主要活动中:
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
if (connectionResult.hasResolution()) {
try {
connectionResult.startResolutionForResult(this, RESOLVE_CONNECTION_REQUEST_CODE);
} catch (IntentSender.SendIntentException e) {
// Unable to resolve, message user appropriately
}
} else {
GooglePlayServicesUtil.getErrorDialog(connectionResult.getErrorCode(), this, 0).show();
}
}
我最终不得不导入一个 bundlea 库,但我仍然无法修复这个错误:
RESOLVE_CONNECTION_REQUEST_CODE cannot be resolved to a variable
有任何想法吗???我不知道哪个库包含这个常量......