Alert to enable gps and network , location
<p>I want to test if the gps is enabled and if so to show an alert </p>

<pre><code>            protected void createGpsDisabledAlert() {
    AlertDialog builder = new AlertDialog.Builder(this).create();
    builder.setMessage("Your GPS is disabled! Would you like to enable it?");

    builder.setButton("Enable GPS", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            showGpsOptions();
        }

    });
    builder.setButton2("Do nothing", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            return;
        }
    });

    builder.show();
}

private void showGpsOptions() {
    Intent gpsOptionsIntent = new Intent(
            android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
    startActivity(gpsOptionsIntent);

}
</code></pre>

<p>I did debug and it seems everything ok , i have no error , but the alert does not appear, even if it eneters in method </p>

<p>Thank you in advance</p>
