@@ -113,15 +113,19 @@ private boolean isBetween(double minAngle, double maxAngle, double azimuth) {
113
113
return false ;
114
114
}
115
115
116
+ private void updateDescription () {
117
+ descriptionTextView .setText (mPoi .getPoiName () + " azimuthTeoretical "
118
+ + mAzimuthTeoretical + " azimuthReal " + mAzimuthReal + " latitude "
119
+ + mMyLatitude + " longitude " + mMyLongitude );
120
+ }
121
+
116
122
@ Override
117
123
public void onLocationChanged (Location location ) {
118
124
mMyLatitude = location .getLatitude ();
119
125
mMyLongitude = location .getLongitude ();
120
- descriptionTextView .setText (mPoi .getPoiName () + " azimuthTeoretical "
121
- + mAzimuthTeoretical + " azimuthReal " + mAzimuthReal + " latitude "
122
- + mMyLatitude + " longitude " + mMyLongitude );
123
126
mAzimuthTeoretical = calculateTeoreticalAzimuth ();
124
127
Toast .makeText (this ,"latitude: " +location .getLatitude ()+" longitude: " +location .getLongitude (), Toast .LENGTH_SHORT ).show ();
128
+ updateDescription ();
125
129
}
126
130
127
131
@ Override
@@ -140,9 +144,7 @@ public void onAzimuthChanged(float azimuthChangedFrom, float azimuthChangedTo) {
140
144
pointerIcon .setVisibility (View .INVISIBLE );
141
145
}
142
146
143
- descriptionTextView .setText (mPoi .getPoiName () + " mAzimuthTeoretical "
144
- + mAzimuthTeoretical + " mAzimuthReal " + mAzimuthReal + " mMyLatitude "
145
- + mMyLatitude + " lon " + mMyLongitude );
147
+ updateDescription ();
146
148
}
147
149
148
150
@ Override
@@ -168,7 +170,6 @@ private void setupListeners() {
168
170
myCurrentAzimuth .start ();
169
171
}
170
172
171
-
172
173
private void setupLayout () {
173
174
descriptionTextView = (TextView ) findViewById (R .id .cameraTextView );
174
175
0 commit comments