Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View janishar's full-sized avatar
🚀
I help developers become better coders

Janishar Ali janishar

🚀
I help developers become better coders
View GitHub Profile
@RohitSurwase
RohitSurwase / CoroutineIntentService.kt
Last active February 4, 2023 10:02
IntentService (Service) using Kotlin Coroutines instead of Handler+Looper.
import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.support.annotation.Nullable
import android.support.annotation.WorkerThread
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.channels.actor
import kotlin.coroutines.CoroutineContext