I have two threads, one of them starts when i press a button. it just display values from 1-20 on the button btn.settext(""+ j)
. inside the listener fo that button I wrote the following:
btn_listener.setOnClickLstener(new Listener) {
public void onClickListener(view v) {
if (!t2.isAlive()) {
t2.start()
}
}
}
t2 is a thread. what happens at run time is, when I click the button while the thread2 is running nothing happens, but, when the thread2 finishes it job and i ckick the button the app crashes. any reason why that happens?