In my project I have provided an option for save multiple credentials. When a user logs in, they have to select their credential. In between if they want to move to another credential then they would have to logout and login to other credentials. Here I am not closing the application.
Now, in my project when someone click on Logout button then all Running Threads are getting stopped. Is there any shortcut method to stopped all running threads in my application?
Thanks in advance.
Put them all in an ExecutorService and order it to shutdown all the threads in his pool.