Skip to content

Instantly share code, notes, and snippets.

@kathisai
Created August 16, 2019 15:20
Show Gist options
  • Select an option

  • Save kathisai/4e888970a1f9f4327dbd52f325d0b8ee to your computer and use it in GitHub Desktop.

Select an option

Save kathisai/4e888970a1f9f4327dbd52f325d0b8ee to your computer and use it in GitHub Desktop.
class ExampleService : IntentService("ExampleService") {
override fun onHandleIntent(intent: Intent?) {
// Normally we would do some work here, like download a file.
// For our sample, we just sleep for 5 seconds.
try {
Thread.sleep(5000)
} catch (e: InterruptedException) {
// Restore interrupt status.
Thread.currentThread().interrupt()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment