我正在回收提供的代码,以便在从http://developer.android.com/training/location/retrieve-current.html获取位置数据之前检查用户的设备是否具有Google Play服务。当复制粘贴到我IDE,Eclipse中正确地指出了线的错误,因为“connectionResult”从来没有被定义的,也不是“getSupportFragmentManager”不明确的Android当前位置检索教程
int errorCode = connectionResult.getErrorCode();
和
errorFragment.show(getSupportFragmentManager(),
"Location Updates");
我应该创建上面的一个变量叫做ConnectionResult connectionResult来解决这个问题?我不知道如何纠正第二个问题。
此外,该行
mLocationClient = new LocationClient(this, this, this);
进一步沿着页面建议在MainActivity类不满足LocationClient构造,唤起另一个错误推杆。
更新:本教程的另一个问题。大家好,本教程引用它尚未在此创建的类LocationResult:http://developer.android.com/training/location/receive-location-updates.html。我应该如何/在哪里定义这个?
你的标题是不是与你的描述 – juned
@juned谢谢你,我希望现在更清楚 – NumenorForLife