Example #1
0
 public void onLocationChanged(Location newLocation) {
   if (newLocation.getLatitude() == 0.0 && newLocation.getLongitude() == 0.0) {
     // Hack to filter out 0.0,0.0 locations
     return;
   }
   mLastLocation.set(newLocation);
   mValid = true;
 }
 public void setLocation(Location l) {
   mLocation.set(l);
   mHasLocation = true;
   try {
     mLocationManager.reportLocation(mLocation, false);
   } catch (RemoteException e) {
     Log.e(TAG, "RemoteException calling reportLocation");
   }
 }
 @Override
 public void onLocationChanged(Location newLocation) {
   if (newLocation.getLatitude() == 0.0 && newLocation.getLongitude() == 0.0) {
     // Hack to filter out 0.0,0.0 locations
     return;
   }
   if (!mValid) {
     Log.d(TAG, "Got first location.");
   }
   mLastLocation.set(newLocation);
   mValid = true;
 }
 @Override
 public void onLocationChanged(Location location) {
   Log.d(TAG, "onLocationChanged: " + location);
   mLastLocation.set(location);
 }
Example #5
0
 /**
  * Updates current user location for measuring.
  *
  * @param location user's current location
  */
 public void setUserLocation(Location location) {
   userLocation.set(location);
 }