Should findviewbyid be called in the user interface thread?

Question: should I Activity.findViewByIdonly call in the user interface thread?

The reason I ask is because I call it an arbitrary thread, and it works flawlessly. But then I got an exception from one of the users: findViewByIddoes not work with NPEsomewhere in findViewTraversal.

So, could this be the reason?

+5
source share
1 answer

The Android UI toolkit is not thread safe and should always be controlled by the user interface thread.

Taken from Tight Thread .

, , , API . , , , , , . .

, , .

+5

All Articles