title: Android device GPS on/off programmatically
body: <p>I am using following code for GPS on/off.</p>
  
  <pre><code>//Enable GPS
  Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
  intent.putExtra("enabled", true);
  context.sendBroadcast(intent);
  //Disable GPS
  Intent intent = new Intent("android.location.GPS_ENABLED_CHANGE");
  intent.putExtra("enabled", false);
  context.sendBroadcast(intent);
  </code></pre>
  
  <p>Programmatically I need to on/off GPS on android device.
  I am using above code for that. But It doesn't work on all the devices.</p>