How do I make java quit the program when it is triggered? I have tried pretty much everything I can do, but I just can't make it quit.
You can use System.exit(0);
where 0
is the exit code. This works on all platforms (including android).
Here is a link to the official documentation if you require further reading: Oracle Documentation