【问题标题】:Android LocationServices - how to test onConnectionSuspended callbackAndroid LocationServices - 如何测试 onConnectionSuspended 回调
【发布时间】:2016-08-19 12:07:15
【问题描述】:

我在 Android 上使用 Google Play 服务位置 API,我试图弄清楚如何测试 onConnectionSuspended(int cause) 回调,它是GoogleApiClient.ConnectionCallbacks 的一部分。

我已尝试关闭 WiFi、GPS 等,但无法触发此回调。我正在测试的设备没有蜂窝服务提供商,所以我认为将这两个都关闭会起作用...

有人有什么想法吗?

谢谢

【问题讨论】:

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


    【解决方案1】:

    selected answer here 描述了如何模拟/测试断开与 Google Play 服务的连接。重要的是与播放服务断开连接,而不必与 Internet 断开连接 - 正如您在测试中所假设的那样。希望这会有所帮助!

    【讨论】:

    • 糟糕,我什至没有看到那个帖子!谢谢。
    • 我对延迟回复表示歉意。谢谢,提供的链接有效!
    猜你喜欢
    • 1970-01-01
    • 2015-02-05
    • 1970-01-01
    • 1970-01-01
    • 2022-11-24
    • 2018-07-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多