调用connect(),当我连接时,DriveApi

时间:2015-03-02 19:09:27

标签: android google-drive-api

我遇到问题,当我尝试连接到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());

    }
}

1 个答案:

答案 0 :(得分:0)

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