Understanding Android Looper

Let's explain the Looper class. We used it in previous examples but we did not explain it in details.

Looper represents a class that is used to execute messages or runnable instances in a queue. Ordinary threads do not have any queue like the Looper class has.

Where we can use the Looper class? For the execution of multiple messages or runnable instances, Looper is needed! One example of use can be adding new tasks to the queue while, at the same time, the operation of task processing is running.

Get Mastering Android Development with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.