Android 4.1.2 Jak programowo wyłączyć GPS

Próbuję włączyć GPS kodem. Oto kod, którego użyłem.

String provider = Settings.Secure.getString(context.getContentResolver(),Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
if(provider.contains("gps")){ //if gps is enabled
    final Intent poke = new Intent();
    poke.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
    poke.addCategory(Intent.CATEGORY_ALTERNATIVE);
    poke.setData(Uri.parse("3")); 
    context.sendBroadcast(poke);

Kod wykonywany w funkcji OnReceive. Co ja robię źle?

questionAnswers(5)

yourAnswerToTheQuestion