【发布时间】:2014-12-18 16:17:10
【问题描述】:
我正在通过 google play 服务链接我的应用程序 - drive api。在我尝试取消链接我的申请表用户的谷歌驱动器帐户之前工作正常。我找到了一种使用 Plus API 之类的方法;
mApi = new GoogleApiClient.Builder(context)
.addApi(Drive.API)
.addApi(Plus.API)
.addScope(Drive.SCOPE_APPFOLDER)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
...
...
Plus.AccountApi.clearDefaultAccount(mApi);
mApi.disconnect();
但这实际上对我没有多大帮助。当我将我的应用重新链接到谷歌驱动器时,帐户选择意图没有出现。 (我的帐户没有激活 Google Plus 服务!)
还有其他方法可以取消应用与 google-drive 的链接。我想知道为什么 Drive::DriveApi::clearDefaultAccount 不存在?
编辑:
好吧,作为一种解决方法;
mApi.clearDefaultAccountAndReconnect();
mApi.disconnect();
这将清除身份验证数据并且 mApi.disconnect() 不会让重新连接...我仍然想知道是否有任何优雅的解决方案...
【问题讨论】:
标签: android google-drive-api google-play-services google-drive-android-api