Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
谷歌驱动Android API教程发行_Android_Google Drive Android Api - Fatal编程技术网

谷歌驱动Android API教程发行

谷歌驱动Android API教程发行,android,google-drive-android-api,Android,Google Drive Android Api,接下来,我将此代码粘贴到我的主要活动中: @Override public void onConnectionFailed(ConnectionResult connectionResult) { if (connectionResult.hasResolution()) { try { connectionResult.startResolutionForResult(this, RESOLVE_CONNECTION_REQUEST_CODE);

接下来,我将此代码粘贴到我的主要活动中:

@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();
    }
}
我最终不得不导入一个buncha库,但我仍然无法修复此错误:

RESOLVE_CONNECTION_REQUEST_CODE cannot be resolved to a variable

有什么想法吗???我不知道哪个库包含这个常量…

当教程指定从一个android项目开始时,他们指的是一个Google Drive android项目,它有不同的导入和类定义,这在教程中没有明确说明。他们实际上为Google Drive android项目提供了一些启动代码,但他们错误地将其标记为“android快速启动”,因此我认为它与任何其他android项目没有什么不同

这里是链接的地方:,如果您使用此代码作为参考,本教程将更有意义

如果有人想知道原始问题的解决方法是什么,那么常数实际上应该是
REQUEST\u code\u RESOLUTION
,但是还有很多更改,所以只需使用