how to reload main activity after click "OK" on AlertDialog
<p>I have an AlertDialog and I want the Main Activity to reload after I have click "OK". The problem is after I have click OK my activity returned to the home screen.</p>

<p><strong>JAVA Code :</strong> </p>

<pre><code>private void buildAlertMessageNoGps() {
    final AlertDialog.Builder builder = new AlertDialog.Builder(this);
    builder.setMessage(
        "This application needs GPS satellite or Wireless Networks localization enabled" 
        + "\n" + "Do you want to enable it?")
        .setCancelable(true)
        .setPositiveButton("Yes",
    new DialogInterface.OnClickListener() {
        public void onClick(final DialogInterface dialog, @SuppressWarnings("unused") final int id) {
            startActivity(new Intent(
            Settings.ACTION_LOCATION_SOURCE_SETTINGS));
            finish();
            startActivity(getIntent());
        }

    })
        .setNegativeButton("No", new DialogInterface.OnClickListener() {
        public void onClick(final DialogInterface dialog, @SuppressWarnings("unused") final int id) {
            dialog.cancel();


        }
    });

    final AlertDialog alert = builder.create();

    alert.show();

}
</code></pre>

<p>Help would be appreciated.</p>
