Changes

Jump to: navigation, search

Kotlin Threads and AsyncTasks

24 bytes added, 21:55, 30 November 2017
no edit summary
Threads are the cornerstone of any multitasking operating system and can be thought of as mini-processes running within a main process, the purpose of which is to enable at least the appearance of parallel execution paths within applications.
== The The Application Main Thread ==
When an Android application is first started, the runtime system creates a single thread in which all application components will run by default. This thread is generally referred to as the main thread. The primary role of the main thread is to handle the user interface in terms of event handling and interaction with views in the user interface. Any additional components that are started within the application will, by default, also run on the main thread.
Clearly, anything that is going to take time to complete within the buttonClick() method needs to be performed within a separate thread.
<htmlet>as30kotlin</htmlet>
== Subclassing AsyncTask ==

Navigation menu