Android: all actions in an Android application are performed in a single thread or a separate thread?

I want to know if all the actions in an Android application are performed in a single thread or a separate thread?

+6
java android android-activity
May 24 '11 at 18:14
source share
2 answers

All actions of one application are performed on the same "main" thread, also called "UI-thread". But you can change this behavior by setting the process attribute to the actvity tag in the manifest file. See http://developer.android.com/guide/topics/manifest/activity-element.html#proc

+13
May 24 '11 at 18:18
source share

Read a detailed explanation here ... Processes and threads

Quote from him ...

When the application component starts and the application has no other running components, the Android system launches a new Linux process for the application with a single thread of execution. By default, all components of the same application run in the same process and thread (called the "main" thread). If an application component starts and there is already a process for that application (since there is another component from the application), then the component starts in this process and uses the same thread of execution. However, you can organize various components in your application to run in separate processes, and you can create additional threads for any process.

+2
May 24 '11 at 18:30
source share



All Articles