Android how to turn off gps icon after press return back button to home screen ? -


I have this problem, when I want to get back home Icon GPS, to get latitude and longitude, I I'm using GPS from my app to always show off my mobile device, how can I turn it off after returning to the home screen

 Enter the image details here My code.

  Implementation of public class doctorlocation activity LocationListener {protected LocationManager locationManager; Protected LocationListress Location Station; Protected Reference Reference; String lathes; String provider; Protected double latitude, longitude; Protected Boolean GPS_Annal, Network_Account; @ Override Protected Zero (Bundle Saved Instantstate) {Super. NET (Saved Instantstate); SetContentView (R.layout.doctorlocation); LocationManager = (LocationManager) getSystemService (event .LOCATION_SERVICE); LocationManager.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0, this); } @ Override location change to public spaces {location location} {// txtLat = (TextView) findViewById (R.id.textview1); //txtLat.setText ("Latitude:" + location.getLatitude () + ", Longitude:" + location.getLongitude ()); String str = "latitude:" + location.getLatitude () + "\ nLongitude:" + location.getLongitude (); Toast. Make text (getBaseContext (), str, toast.lNGTH_LONG). Show (); Latitude = location.getLatitude (); Longitude = location.getLongitude (); } @ Override Public Records on Provider Disabled (String Provider) {Log D. ("Latitude", "Disable"); Toast. Make text (getBaseContext), "GPS off", toast. LNNHHLog). Show (); } @ Override Provider enabled on public zero (string provider) {Log D. ("Latitude", "enabled"); Toast. MakeBaseContext (), "GPS On", Toast. LNNHHLANG). Show (); } {@Override Public Zero} on {@StatusChanged (String Provider, Intet Status, Bundle Extras) {Log D. ("Latitude", "position"); }}    

this code on wipe () Use it to be activity

  @ override protected at zero () {log.i ("onpause", "onpause inside"); Super.onPause (); LocationManager.removeUpdates (myLocationListener); // locationManager.removeUpdates (this); LocationManager = Null; }    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -