Android Listen For Change in GPS Status?
问题 Hello I need to know how to listen for the following with the GPS in Android so I can update the UI in a PreferenceActivity . I have tried GpsStatus.Listener with nothing happening. GpsStatus.GPS_EVENT_STARTED GpsStatus.GPS_EVENT_STOPPED Any suggestions would be great. 回答1: mLocationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); // Define a listener that responds to location updates mGPSStatusListener = new GpsStatus.Listener() { public void onGpsStatusChanged