Loading lesson…
Level 1 · Apprentice0 XP
One thread, one queue: the idea behind Android's Looper, the browser and Node.js. Android is the example here.
Step 1 / 6
ProblemA button reads a file on click. The whole screen stops: no animation, no taps. After 5 seconds Android shows "App not responding".
← → step
Before this: What synchronized really does
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.In a test app, add a button that sleeps 3 seconds on the main thread and watch the freeze. Fix it with a coroutine on Dispatchers.IO and update the text with the result back on the main thread.