Skip to main content

All Questions

Filter by
Sorted by
Tagged with
-2 votes
4 answers
3k views

Thread.stop() is deprecated. But how to use TimerTask instead?

I have started a thread on press of a toggle button. Now I want to stop that thread on pressing that toggle button again. But Thread.stop() API has been deprecated. So, I am getting ...
Rohit Singla's user avatar
0 votes
2 answers
1k views

How can I programmatically cause a delay in Android?

I tried to use Thread.sleep() but it didn't work. When I use it, the app stops responding. I need to put some delays in my code like this: public void inicioJogo(){ for (int jogada = 1; ...
Michael Marcel's user avatar