Remove all the activites before restarting app.
<p>Does someknow how I get set flags at the main (startup) activity? I want that all activties will be removed of the stack. </p>

<p>This is my code know, but it doenst work:</p>

<pre><code>/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
Intent mainIntent = new Intent(this, Main.class);

mainIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(mainIntent);

setContentView(R.layout.splashscreen);

LoadData();
</code></pre>

<p>}</p>

<p>I have also tried to use <code>android:clearTaskOnLaunch</code> but that seems not to work...</p>
