This hole is more obscure, generally not easy to appear.
It is possible to set the UI in the Postresult () method when using Asynctask, but to be told that the UI exception cannot be set on a non-UI thread.
This actually applies a bug when the app is launched. Asynctask is at the time of initialization, take the current thread to get looper. But here 's the problem.
The current thread may not be the UI thread, so it causes the Postresult () to work in the UI thread, and so on, actually in a non-UI thread.
Google resolved this bug in the 4.1 release, that is, when the app starts, it first calls the Asynctask.init () at the UI line thread. So in the current application, Asynctask's looper is the UI thread's Looper.
But in the previous version of 4.1, before using Asynctask, you could call Asynctask.init () in the UI thread yourself.
Android Development stepped in the pit of the four: low version using Asynctask