Code example for LocationManager

Methods: removeGpsStatusListenerremoveUpdates

0
			else { 
				//Log.v("A","#########################################"); 
				//Log.v("A","BestLocation found return result to main. sat_count=" + sat_count); 
				//Log.v("A","#########################################"); 
				// removing all updates and listeners 
				lm.removeUpdates(gpsLocationListener); 
				//myLocationManager.removeUpdates(networkLocationListener);     
				lm.removeGpsStatusListener(gpsStatusListener); 
				// send best location to locationResult 
				if (sat_count < min_gps_sat_count) { 
					// If our sat_count isn't enough, then return null 
					curLocation = null; 
					Log.i(LOG_TAG, "GPS Location Failed: sat_count="+sat_count); 
				} 
 
				if (log_stats == 1) { 
					// LOG STATS 
					if (curLocation != null) 
					{ Log.i(LOG_TAG, "STAT: "+(counts/2)+" seconds to aquire GPS Location (sat_count="+sat_count+")."); } 
				}