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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user