Code example for LocationManager

Methods: getProvidersremoveUpdates

		Toast.makeText(context, "Provider "+provider+", Status="+status, Toast.LENGTH_SHORT).show();
	public void disableProviders( ) { 
		locationManager = (LocationManager) context.getSystemService( Context.LOCATION_SERVICE );
		locationManager.removeUpdates( this );
		debug(0, "Removed updates for "+locationManager.getProviders(true) );
	 * Init the Network/GPS/WiFi Location Provider. 
	public void initLocation( Context context ){
		String provider = getProvider();
		debug(0, "Init Location provider: "+provider );
		// Acquire a reference to the system Location Manager 
		locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
		Location lastKnownLocation = locationManager.getLastKnownLocation( provider );
		//debug(0, "context is "+context ); 
Experience pair programming with AI  Get Codota for Java