按照这个教程的步骤,我将以下代码粘贴到了我的主活动(Main Activity)中:
@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();
}
}
我不得不导入很多库,但我仍然无法解决这个错误:
RESOLVE_CONNECTION_REQUEST_CODE cannot be resolved to a variable
任何想法?我无法确定哪个库包含此常量...