57 |
if (provider.equalsIgnoreCase("gps")) |
if (provider.equalsIgnoreCase("gps")) |
58 |
hasGps = true; |
hasGps = true; |
59 |
locManager.requestLocationUpdates(provider, 0, 0, this); |
locManager.requestLocationUpdates(provider, 0, 0, this); |
60 |
|
Location tmpLastKnown = locManager.getLastKnownLocation(provider); |
61 |
saveLastKnownLocation(locManager.getLastKnownLocation(provider)); |
if (tmpLastKnown != null) { |
62 |
|
saveLastKnownLocation(tmpLastKnown); |
63 |
|
} |
64 |
} |
} |
65 |
} else { |
} else { |
66 |
// message that no suitable provider was found |
// message that no suitable provider was found |
81 |
if (hasGps) { |
if (hasGps) { |
82 |
if (!location.getProvider().equals("gps")) { |
if (!location.getProvider().equals("gps")) { |
83 |
return; // at least give the gps a chance |
return; // at least give the gps a chance |
84 |
} else if (location.getAccuracy() > 256) { |
} else if (location.getAccuracy() > 512) { |
85 |
return; //if we have a gps provider lets wait for a more precise fix |
return; //if we have a gps provider lets wait for a more precise fix |
86 |
} |
} |
87 |
|
|