How to enable GPS programmatically, as it does happen in the official Google Maps app by just clicking on the \'turn on\' option on the pop up screen (without navigating to
That's because they are using the Settings API in the play services as described in Commonsware's answer, which is a bit difficult. You are better off with the "old" method:
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);