編程新手我知道我正在做的事情可能顯然是錯誤的做傳遞或使用錯誤的變量,但我不能解決什麼。無法解析符號myLatitude
這裏是我的代碼:
public class CameraViewActivity extends Activity implements
SurfaceHolder.Callback, OnLocationChangedListener, OnAzimuthChangedListener {
private double mAzimuthReal = 0;
private double mAzimuthTheoretical = 0;
private static double AZIMUTH_ACCURACY = 5;
private double mMyLatitude = 0;
private double mMyLongitude = 0;
private List<Double> calculateAzimuthAccuracy(double azimuth) {
double minAngle = azimuth - AZIMUTH_ACCURACY;
double maxAngle = azimuth + AZIMUTH_ACCURACY;
List<Double> minMax = new ArrayList<Double>();
@Override
public void onAzimuthChanged(float azimuthChangedFrom, float azimuthChangedTo) {
mAzimuthReal = azimuthChangedTo;
mAzimuthTheoretical = calculateTheoreticalAzimuth();
pointerIcon = (ImageView) findViewById(R.id.icon);
double minAngle = calculateAzimuthAccuracy(mAzimuthTheoretical).get(0);
double maxAngle = calculateAzimuthAccuracy(mAzimuthTheoretical).get(1);
if (isBetween(minAngle, maxAngle, mAzimuthReaal) {
pointerIcon.setVisibility(View.VISIBLE);
}
else {
pointerIcon.setVisibility(View.INVISIBLE);
}
updateDescription();
}
感謝您閱讀
歡迎來到Stack Overflow!請[請重新參觀](http://stackoverflow.com/tour)以查看網站的工作原理和問題,並相應地編輯您的問題。另請參閱:[如何創建最小,完整和可驗證的示例](http://stackoverflow.com/help/mcve) –
您的字段未在'onAzimuthChanged'中引用...也請不要大寫變量,請 –
他們未解決哪些行?你幾乎在任何地方都在使用它們。 –