In this video, learn how to use the launch function to start a coroutine. Review the input to the function as well as how to simulate a delay.
- (Instructor) Before we start working…with coroutines in our code directly.…Let's go over working with the launch function,…by means of a few text examples.…So we're here in the coroutines launch test class,…and we're going to start by adding some code…to the start with launch no sleep method.…Now the most basic way to start a coroutine…is with the launch function.…So we're going to start here on line nine,…and we're just going to add a few markers for ourselves,…by means of print line statements.…So we're going to do starting, duplicate this,…and then we're going to put stopping.…
Okay, and in between is where we'll handle…our coroutine information.…So first with the call to launch,…this is how we're going to initiate our coroutine.…Now let's just take a quick peek at…the definition of this particular function.…You'll see that it takes in the coroutine context,…which is related to the threads that…you want your work to happen on.…Next, the coroutine start enum,…which gives you some control over…when the coroutine is executed.…
- What Kotlin has to offer
- Working with lambdas
- Common Android extension functions
- Kotlin Android Extensions overview
- Making use of the Anko library
- Working with coroutines
- Nullability and collections
Skill Level Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis3h 59m Intermediate
Developing AWS Lambda Functions with Kotlinwith Troy Miles1h 55m Intermediate
1. Kotlin Overview
2. Extension Functions and Properties
3. Incorporating Anko
4. Advanced Anko
5. Working with Collections
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.