Most Android apps perform one or more background tasks, often including the ones that are long-running. Examples include making a network call, an I/O request, database read/write — you get the idea.
More often than not, upon completion of these background tasks, we need to take an action that’s visible to the user. These can include:
A confirmation Toast msg — upon a successful DB call Taking the user to a new screen — upon a successful sign-in network call Showing an error msg popup —upon the failure of an I/O operation…or anything, literally!
Continue reading “Handling Background Tasks with Kotlin Coroutines in Android”