Moved mListener.onFirstFix() call in AndroidGPS.onLocationChanged()

Moved mListener.onFirstFix() call to be within the null check block for
mListener

closes #39

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-05-06 00:49:41 -04:00
parent d8159587a5
commit c5570b4aa4

View File

@@ -85,14 +85,15 @@ public class AndroidGPS implements LocationListener {
*/
@Override
public void onLocationChanged(Location location) {
if(mListener != null)
if(mListener != null) {
mListener.onLocationChanged(new GeoPoint( (int) (location.getLatitude() * 1e6), (int) (location.getLongitude() * 1e6)), (int) location.getAccuracy());
mListener.onFirstFix(isFirstFix);
}
if(mLocationListener != null){
mLocationListener.onLocationChanged(location);
}
mListener.onFirstFix(isFirstFix);
isFirstFix = false;
}