Code example for LocationManager: Getting continuous location updates

Methods: addGpsStatusListenerrequestLocationUpdates

0
 
	} 
	 
	public void requestLocationUpdates(boolean request) {
		if (request) {
			lmgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,	this);
			lmgr.addGpsStatusListener(this);
		} else { 
			lmgr.removeUpdates(this);
			lmgr.removeGpsStatusListener(this);
		} 
	} 
 
	@Override 
	public void onGpsStatusChanged(int event) {
		// Update GPS Status image according to event 
		ImageView imgSatIndicator = (ImageView) findViewById(R.id.gpsstatus_record_imgSatIndicator);
 
		switch (event) {
		case GpsStatus.GPS_EVENT_FIRST_FIX:
Contextual code suggestions in your IDE  Get Codota for Java