Thursday, May 3, 2012

[android-developers] Re: How to enable/disable GPS , Wi-Fi hotspots programmatically?

As a small addendum to what Mark said, to enable/disable the GPS
through settings, you can start the related activity using the
following code:

Intent intent = new
Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);

Starting the related activity for enabling/disabling Wi-Fi should be
something similar. I've never done it in my apps.

-------------------------------------------------
Ali Chousein
http://socialnav.blogspot.com | http://twitter.com/socialnav1
http://weatherbuddy.blogspot.com | http://twitter.com/weather_buddy
http://www.paygol.com/android/implementation
http://geo-filtered-assistant.blogspot.com

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate