Environment.Exit(0) closes the entire IDE and causes the Android app to terminate unexpectedly, instead of just ending the C# script.