title: Intent to turn ON GPS and back to application
body: <p>This code is able to go to GPS settings and turns it ON but on pressing back it does not intent back to application. Instead it takes me to the home of my launcher.</p>
  
  <pre><code>        public void createDialog(){
          AlertDialog.Builder alert = new AlertDialog.Builder(this);
          alert.setTitle(R.string.gps_message);
          alert.setPositiveButton(R.string.gps_settings, new DialogInterface.OnClickListener() {
  
              public void onClick(DialogInterface dialog, int which) {
                  startActivityForResult(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
                  return;
              }
          });
  
          alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
  
              public void onClick(DialogInterface dialog, int which) {
                  return;
              }
          });
          alert.create();
          alert.show();
      }
  </code></pre>