谷歌播放位置未连接。调用connect(),并等待onConnected()被调用 [英] Google Play Location Not connected. Call connect() and wait for onConnected() to be called
本文介绍了谷歌播放位置未连接。调用connect(),并等待onConnected()被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正很奇怪的崩溃在我的一些用户。我使用谷歌播放服务和位置服务。错误是:
I am getting very strange crash for some of my users. I am using Google Play Services and the Location service. The error is:
Not connected. Call connect() and wait for onConnected() to be called.
在code,它说的是导致飞机失事的原因的相关功能是:
The relevant function in the code that it says is causing the crash is:
@Override
public void onConnected(Bundle bundle) {
if (debug) {
Toast.makeText(this, DateFormat.getDateTimeInstance().format(new Date()) + ": Connected.", Toast.LENGTH_SHORT).show();
}
// Request location updates using static settings
setUpLocationClientIfNeeded();
mLocationClient.requestLocationUpdates(mLocationRequest, this);<---- Crash here
}
但奇怪的是,我不能复制此崩溃在我自己的测试,所以我想不通为什么会发生。
The strange thing is, I can't replicate this crash in my own testing, so I can't figure out why this would be happening.
推荐答案
把 mLocationClient.connect()
之前,你的 requestLocationUpdates
方法。为我工作。
put mLocationClient.connect()
before your requestLocationUpdates
method. Worked for me.
这篇关于谷歌播放位置未连接。调用connect(),并等待onConnected()被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文