Can anyone provide me some code snip开发者_StackOverflow中文版pet for enabling/disabling auto sync and GPS in android? I have been trying for long but no success.
Thanks in advance.
without intervention by the user, this is not possible, but you can start the Intent for the settings
Intent gpsOptionsIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
this.startActivity(gpsOptionsIntent);
精彩评论