Whenever you use some graphics library, this concept will exist: you have one thread that is designed for graphical interfaces, in Java-Swing, called the "Event Manager" EDT , in Android, and also in SWT, it is called UI -Thread. This thread is responsible for all GUI events and manipulations. Long-running actions must be performed in another thread, so the user interface does not block / freeze.
(I think itβs important to understand this basic concept of user interface development, and not just use AsyncTask and think that this is something special for Android)
EDIT
source share