Intent Service
IntentService is an extension of the Service
component class that handles asynchronous requests (expressed as Intent
s) on demand. Clients send requests through Context.startService(Intent)
calls; the service is started as needed, handles each Intent in turn using a worker thread, and stops itself when it runs out of work.
class MyIntentService : IntentService("MyIntentService") {
override fun onHandleIntent(intent: Intent?) {
// Perform some background task here
}
}
Comments
Post a Comment