July 2018
Intermediate to advanced
266 pages
7h 11m
English
With this done, we can now use the dispatcher in the same way we use any other, for example:
launch(dispatcher) { val headlines = fetchRssHeadlines() val newsCount = findViewById<TextView>(R.id.newsCount) launch(UI) { newsCount.text = "Found ${headlines.size} News" }}
Executing the code at this point will work. The quantity of news will be correctly displayed on the application.
Read now
Unlock full access