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()
}});