【问题标题】:calling connect(), while I am connected, DriveApi调用 connect(),当我连接时,DriveApi
【发布时间】:2015-03-04 17:15:00
【问题描述】:

我有一个问题,当我尝试连接到 Drive api 时,我收到以下错误日志:

Calling connect() while still connected, missing disconnect() for com.google.android.gms.drive.ApiService.Start

一个月前它起作用了... 我试过检查if(mGoogleApiClient.isconnected()),但同样的问题。从官方来源(一个月前最新)尝试了 Api 16-21,google-play-services_lib。 有谁知道问题出在哪里?

@Override
protected void onResume() {
    Log.d("activity","resume");
    super.onResume();
    setContentView(R.layout.splash);
    if(onResume == false)
    {
        onResume = true;
        if (mGoogleApiClient == null) {
            // Create the API client and bind it to an instance variable.
            // We use this instance as the callback for connection and connection
            // failures.
            // Since no account name is passed, the user is prompted to choose.
            mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Drive.API)
            .addScope(Drive.SCOPE_FILE)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
        }
        mGoogleApiClient.connect();
    }
    else
    {
        android.util.Log.d("archive", "msg");
        onResume = true;
        Intent intent = new Intent(context, Archive.class);
        intent.putExtra("up", (int) 2);
        context.startActivity(intent);
        //Log.d("intent", intent.getExtras().getString("upload").toString());

    }
}

【问题讨论】:

标签: android google-drive-api


【解决方案1】:

当 Google Play 服务应用程序中的所有数据都被删除时,问题解决了。 我认为,问题在于播放服务何时记住每个成功授权的应用程序。但是我的申请没有成功授权。

【讨论】:

    猜你喜欢
    • 2011-01-10
    • 1970-01-01
    • 2016-06-06
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 2021-02-28
    • 2016-05-19
    • 1970-01-01
    相关资源
    最近更新 更多