I've searched for GPS ON and OFF without passing intent for getting Settings page . Now,I got a solution for that .. To TurnOn, I used the snippets below, String set = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(!set.contains("gps")){ final Intent gpsIntent = new Intent(); gpsIntent .setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider"); gpsIntent.addCategory(Intent.CATEGORY_ALTERNATIVE); gpsIntent.setData(Uri.parse("3")); sendBroadcast(gpsIntent); } and to TurnOFF, String set1 = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(set1.contains("gps")) { final Intent gpsIntent1= new Intent(); gpsIntent1.setClassName("com.android.settings", "com.android.settings.widget.SettingsAp...
In this Blog ,I'm adding what I'm Learning as I trust sharing will sharpen our knowledge and I want others know that what I know.