	public static void doActiveUpdate(final Context context, Boolean useGPS) {
		Log.d(DEBUG_TAG, "force active location update");
		if (locationListener == null) {
			Log.d(DEBUG_TAG, "set up new LocationListener");
			locationListener = new LocationListener() {
				public void onLocationChanged(Location location) {
					Log.d(DEBUG_TAG, "locationListener: location changed. disabling myself");
					LocationManager locationManager = (LocationManager) context
							.getSystemService(Context.LOCATION_SERVICE);
					try {
						Thread.sleep(4000);
					} catch (InterruptedException e) {
					}
					locationManager.removeUpdates(locationListener);
					locationListener = null;
				}
				public void onProviderDisabled(String provider) {
				}
				public void onProviderEnabled(String provider) {
				}
				public void onStatusChanged(String provider, int status,
						Bundle extras) {
				}
			};
			LocationManager locationManager = (LocationManager) context
					.getSystemService(Context.LOCATION_SERVICE);
			SharedPreferences SP = PreferenceManager
					.getDefaultSharedPreferences(context);
			if (SP.getBoolean("activeupdate", false) && useGPS) {
				if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
					Log.d(DEBUG_TAG, "GPS disabled, requesting network location update");
					Toast.makeText(
							context,
							context.getResources().getString(
									R.string.msg_gpsdisabled),
							Toast.LENGTH_SHORT).show();
					locationManager.requestLocationUpdates(
							LocationManager.NETWORK_PROVIDER, 0, 0,
							locationListener);
				} else {
					Log.d(DEBUG_TAG, "requesting GPS location update");
					locationManager.requestLocationUpdates(
							LocationManager.GPS_PROVIDER, 0, 0,
							locationListener); 
				}
			} else {
				Log.d(DEBUG_TAG, "Active lookup disabled, requesting network location update");
				locationManager.requestLocationUpdates(
						LocationManager.NETWORK_PROVIDER, 0, 0,
						locationListener);
			}
			AlarmManager alarmManager = (AlarmManager) context
					.getSystemService(Context.ALARM_SERVICE);
			Intent i = new Intent(context, LocationReceiver.class);
			i.putExtra("de.h3ndrik.openlocation.cancelgps", "true");
			PendingIntent pendingIntent = PendingIntent
					.getBroadcast(context, 0, i,
							PendingIntent.FLAG_UPDATE_CURRENT);
			alarmManager.set(AlarmManager.RTC_WAKEUP,
					System.currentTimeMillis() + 16000,
					pendingIntent);
			Log.d(DEBUG_TAG, "cancelUpdates alarm set");
		}
		else {
			Log.d(DEBUG_TAG, "conflicting locationListener, skipping");
		}
	}

	public static void doActiveUpdate(final Context context, Boolean useGPS) {
		Log.d(DEBUG_TAG, "force active location update");
		if (locationListener == null) {
			Log.d(DEBUG_TAG, "set up new LocationListener");
			locationListener = new LocationListener() {
				public void onLocationChanged(Location location) {
					Log.d(DEBUG_TAG, "locationListener: location changed. disabling myself");
					LocationManager locationManager = (LocationManager) context
							.getSystemService(Context.LOCATION_SERVICE);
					try {
						Thread.sleep(4000);
					} catch (InterruptedException e) {
					}
					locationManager.removeUpdates(this);
					locationListener = null;
				}
				public void onProviderDisabled(String provider) {
				}
				public void onProviderEnabled(String provider) {
				}
				public void onStatusChanged(String provider, int status,
						Bundle extras) {
				}
			};
			LocationManager locationManager = (LocationManager) context
					.getSystemService(Context.LOCATION_SERVICE);
			SharedPreferences SP = PreferenceManager
					.getDefaultSharedPreferences(context);
			if (SP.getBoolean("activeupdate", false) && useGPS) {
				if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
					Log.d(DEBUG_TAG, "GPS disabled, requesting network location update");
					Toast.makeText(
							context,
							context.getResources().getString(
									R.string.msg_gpsdisabled),
							Toast.LENGTH_SHORT).show();
					locationManager.requestLocationUpdates(
							LocationManager.NETWORK_PROVIDER, 0, 0,
							locationListener);
				} else {
					Log.d(DEBUG_TAG, "requesting GPS location update");
					locationManager.requestLocationUpdates(
							LocationManager.GPS_PROVIDER, 0, 0,
							locationListener); 
				}
			} else {
				Log.d(DEBUG_TAG, "Active lookup disabled, requesting network location update");
				locationManager.requestLocationUpdates(
						LocationManager.NETWORK_PROVIDER, 0, 0,
						locationListener);
			}
			AlarmManager alarmManager = (AlarmManager) context
					.getSystemService(Context.ALARM_SERVICE);
			Intent i = new Intent(context, LocationReceiver.class);
			i.putExtra("de.h3ndrik.openlocation.cancelgps", "true");
			PendingIntent pendingIntent = PendingIntent
					.getBroadcast(context, 0, i,
							PendingIntent.FLAG_UPDATE_CURRENT);
			alarmManager.set(AlarmManager.RTC_WAKEUP,
					System.currentTimeMillis() + 16000,
					pendingIntent);
			Log.d(DEBUG_TAG, "cancelUpdates alarm set");
		}
		else {
			Log.d(DEBUG_TAG, "conflicting locationListener, skipping");
		}
	}
