Skip to main content

Questions tagged [system.exit]

The tag has no usage guidance.

system.exit
-1 votes
0 answers
43 views

Java exit status codes based on application warnings vs errors [closed]

I'm developing a Java application where the exit status codes need to reflect the following conditions: Exit with status code 0 if no errors or warnings occur during execution. Exit with status code ...
Meymuna S.'s user avatar
0 votes
0 answers
7 views

What should i write inside JOptionPane.YES_NO_OPTION

so everytime i close my program obviously a window pops up asking if i want to close the app but im not sure what im suppose to write inside if NO is chosen. right now everytime i press no the GUI ...
alon facebo0k1wallacoil's user avatar
0 votes
0 answers
147 views

How to terminate springboot application programmatically on cloud foundry?

I need to terminate a springboot function programmatically with something like System.exit(-1); when running. When I ran the app on my laptop, it could terminate at where I put "System.exit(-1);&...
Henry Bai's user avatar
  • 407
4 votes
3 answers
853 views

Exit Android application from application class (Not activity)

Is there a way to exit android application from the Application class itself. This is even before any activity has been initialized. Scenario is user side-loading the build in an unsupported device ...
Raghav's user avatar
  • 1,054
1 vote
1 answer
351 views

How to write a test case method having System.exit() using Junit 5?

Scenario: Below negative scenario to be tested during Integration test. currently the test case getting failed due exit and not reaching to the test method. example : private void method1(int a){ try{ ...
Vasanthakumar Jagannathan's user avatar
0 votes
1 answer
86 views

Android: Stopping java main method without closing the activity

For Android, I have programmed an App in which a String is given and it is cut into smaller Strings and saved in a String array always after a hyphen. This only happens once a button is pressed and ...
celdrion's user avatar
1 vote
1 answer
1k views

Error Message with System.err.println() before System.exit(-1) in Java

I have a problem with crashed Java Virtual Mashines without error message. I often do some checks in my code. Something went wrong, if one of these checks will not be fulfilled and the java program ...
UweJ's user avatar
  • 489
2 votes
1 answer
2k views

Java Security class to prevent you from terminating the code using exit(0)! in HackerRank

Can anyone explain this code of HackerRank? class DoNotTerminate { public static class ExitTrappedException extends SecurityException { private static final long serialVersionUID = 1; ...
Midnight sun's user avatar
0 votes
1 answer
145 views

Android: Can't call finish()

Why can't I call finish() in the code below? I also can't start any Intent. This is my code: public class EditProfilePresenter<V extends EditProfileView> extends PickImagePresenter<V> { ...
Amer Anajjem's user avatar
2 votes
2 answers
426 views

Testing if a java program calls System.exist - without exiting Junit

I am trying to test a file processing program with Junit. In some cases, the program should print an error and finish its run. However, using "System.exit(-1)" causes the program to exit the entire ...
Roy Sht's user avatar
  • 123
1 vote
0 answers
1k views

Android - System.exit(0) and restart activity and service

I'm making an Android app, and I need to completely restart the app in a moment. So, to do that, the only solution that has worked (and that I can remember) is to use System.exit(0). I have no idea ...
Edw590's user avatar
  • 515
0 votes
1 answer
505 views

How to Exit an application when my app consists of multiple activities? [duplicate]

How to exit application in android when I have multiple activities in that app? I have tried finish() and System.exit(0), but none of them worked. What it does is just go to the previous activity. ...
Nabeel Ahmed's user avatar
1 vote
0 answers
53 views

KeyListener should work and then quit the program but it doesn't(AutoClicker)

I've made an AutoClicker and it works fine, but I wanted to add a KeyListener so that the person who's using it can stop the autoclicker it should work with the button q but it doesn't! Here is the ...
user avatar
2 votes
2 answers
548 views

Confirm program quit when cmd + Q is pressed

I have a program with a JFrame that I use a WindowListener to close the program with. I use the following method to prompt a message about saving changes made in the program: public void ...
floval's user avatar
  • 31
0 votes
1 answer
434 views

Can I exit my android app with code when it is started from a deeplink?

I am building an app which uses either some activities in which the user can navigate or uses one specific activity which starts the app when a deeplink is used. In this DeeplinkActivity I have a ...
iOS-Coder's user avatar
  • 1,231

15 30 50 per page
1
2 3 4 5