private void openGPSSettings()
{
LocationManager alm = (LocationManager)this.getSystemService( Context.LOCATION_SERVICE );
if( alm.isProviderEnabled(android.location.LocationManager.GPS_PROVIDER ) )
{
Toast.makeText( this, "GPS is already on", Toast.LENGTH_SHORT ).show();
}
else
{
Toast.makeText( this, "Please turn on GPS", Toast.LENGTH_SHORT ).show();
Intent myIntent = new Intent( Settings.ACTION_SECURITY_SETTINGS );
startActivity(myIntent);
}
}