To turn it on you have to use the intent:
new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);

Android doesn't let you do it from the code.

To turn it off use
locationManager.removeUpdates(mLocationListener);
locationManager = null;
("locationManager" is and instance of LocationManager)

When you are using the GPS you need the following permission in your
manifest:
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
----
Ali Chousein
Published apps:
- Geo-Filtered Assistant Pro
- Geo-Filtered Assistant Basic (free version)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to