我正在回收提供的代碼,以便在從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