So i am making a game and have three things that could potentially be required to run concurrently.
showDamage - displays a number (in a TextView) for a short moment (~300 milliseconds) then disappears.
delay - for holding a temporary boost. A TextView is also updated at the beginning and end. This is long (~10 seconds).
cooldown - provides textual feedback for the user on time remaining until a button can be pressed again.
I did some browsing and, after trying a Handler which blocked other events, came to the general opinion that i should be using ASyncs as an easy way to make concurrent threads that make changes to the UI and do tasks without blocking the main thread. So i implemented all 3 as Asyncs. I then came upon a problem where they would interfere with each other - the numbers from the showDamage would hang around for longer than 300ms, the temporary effects would become permanent (the postExecution was never run). Further browsing suggested that Android by default has a pool size of 5 and thus i could only have 5 Asyncs running a time. Using MyASync.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, ...) helps a bit but it provides parallelism not concurrency.
I've used a CountdownTimer for cooldown and that seems to have stopped the issue with the temporary effects becoming permanent but the TextViews from showDamage still hang if enough is spammed. Is there a fix for this, and are there any attempts i've probably implemented incorrectly?