【问题标题】:A data connection is required to connect to Google Play Services需要数据连接才能连接到 Google Play 服务
【发布时间】:2014-12-18 07:09:37
【问题描述】:

我在 Activity 中使用 GoogleApiClient 将文件上传到驱动器。实例化 GoogleApiClient,并在 onCreate of Activity 上连接,然后在 onDestroy f Activity 上断开连接。当我启动 Activity 时,显示一个对话框为“网络错误:需要数据连接才能连接到 Google Play 服务”。

  1. 连接 GoogleApiClient 是否必须有 Internet 连接?
  2. 所以每次我启动我的活动时都必须上网?
  3. 我读过 Google Drive API 可以工作,所以如果 Internet 断开连接,Google Drive API 是否可以工作?

【问题讨论】:

    标签: android google-play-services google-api-client google-drive-android-api


    【解决方案1】:

    是的,您应该有一个有效的互联网连接。

    【讨论】:

    • 我尝试连接 GoogleApiClient。在仍然连接时调用 connect() 时出错,缺少 disconnect()。但我在 onCreated 中连接并在 onDestroy 中断开连接。为什么会发生?然后,一旦我将 GoogleApiClient 与互联网连接,然后离线,我的驱动器 api 是否可以工作?
    • 已经可用
    • GoogleApiClient 只需要第一次连接互联网。关闭 WIFI 连接后,GoogleApiClient 即使在断开连接并再次连接后也会连接。
    • 我只是尝试快速入门示例我有一些错误请看这个....stackoverflow.com/questions/27636659/…请帮助我
    猜你喜欢
    • 2019-02-17
    • 2013-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多