0

I have an android app that works with threads. There is a button that has an onClick function in which the start() method is called. When I press the button once it works fine. When I press the button a second time, the app crashes with the following lines: E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-2

This is what the onClick function looks like:

testButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
    // e is an object that starts 8 threads to solve something mathematicly challenging
    e.start()
    }});
Matej Dražić
  • 43
  • 1
  • 1
  • 5
  • 6
    Does this answer your question? [Is it legal to call the start method twice on the same Thread?](https://stackoverflow.com/questions/1215548/is-it-legal-to-call-the-start-method-twice-on-the-same-thread) – Amin Jun 07 '21 at 23:30

0 Answers0