title: How to restart an application completely?
body: <p>I have an application which starts a Remote Service in its first launched activity. Then, in another activity, the user can set the configuration of the application. Please note that this second activity isn't bound to the Service and I don't wish to bind it.</p>
  
  <p>Now my question is : how could I restart the whole application from the second activity, after changing the configuration settings?</p>
  
  <p>For now, I am using a button which onClickListener is :</p>
  
  <pre><code>public void onClick(DialogInterface dialog, int which) {
      sauvegarde();
      Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage(getBaseContext().getPackageName());
      i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      startActivity(i);
  }
  </code></pre>
  
  <p>The problem is : it only restarts the current activity without shutting the whole application, and therefore, without restarting the service</p>
  
  <p>Any ideas?</p>