【发布时间】:2013-05-31 05:51:42
【问题描述】:
我正在回收提供的代码,以在从http://developer.android.com/training/location/retrieve-current.html 获取位置数据之前检查用户的设备上是否有 Google Play 服务。将其复制粘贴到我的 IDE 中时,Eclipse 会正确指出行中的错误,因为从未定义过“connectionResult”,也没有定义过“getSupportFragmentManager”
int errorCode = connectionResult.getErrorCode();
和
errorFragment.show(getSupportFragmentManager(),
"Location Updates");
我应该只在上面创建一个名为 ConnectionResult connectionResult 的变量来解决问题吗?我不确定如何纠正第二个。
另外,一行
mLocationClient = new LocationClient(this, this, this);
从页面的后面开始,建议放入不满足 LocationClient 构造函数的 MainActivity 类,从而引发另一个错误。
更新:教程的另一个问题。大家好,本教程引用了尚未在此处创建的类 LocationResult:http://developer.android.com/training/location/receive-location-updates.html。我应该如何/在哪里定义这个?
【问题讨论】:
-
您的标题与您的描述无关
-
@juned 谢谢,我希望现在更清楚了
标签: android