On Sep 26, 2012, at 5:50 AM, MysteriX <[email protected]> wrote:
> i want to end my app. I have a menu with an "End" Button. But when i use this 
> code:
> System.Environment.Exit(0);
> 
> then the result is not what i want. the activity shut´s down but another 
> activity appears.

Android thinks your app crashed, and since it's the topmost activity Android 
will "helpfully" restart the process+Activity.

If you want your Activity to close, you should call Activity.Finish():

        http://androidapi.xamarin.com/?link=M%3aAndroid.App.Activity.Finish()

Generally, you shouldn't exit your process so that if the user restarts your 
app the Activity will launch faster (no process startup). Let Android worry 
about process lifetimes.

 - Jon

_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to