private void getLocation() {
try {
locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
criteria = new Criteria();
if (locationManager == null) {
Log.d(TAG, "locationManager == null");
}
location = locationManager.getLastKnownLocation(locationManager
.getBestProvider(criteria, false));
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
6000, 1, (LocationListener) this);
if (location == null) {
location = locationManager.getLastKnownLocation(locationManager
.getBestProvider(criteria, false));
locationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER,
2000, 1, (LocationListener) this);
}
if (location == null) {
if (map != null) {
location = map.getMyLocation();
}
}
} finally {
Log.d("getLocation","Unable load getLcation()");
}
}