If Handler objects are tied to a UI thread, it is safe to update the array in Handler (assuming the array is also associated with the UI thread).
Check out the Handler documentation , especially this part:
The handler allows you to send and process Message and Runnable objects associated with the MessageQueue stream. Each Handler instance is associated with one thread and this thread's message queue. When you create a new handler, it is attached to the thread / message queue of the thread that creates it - from this point it will deliver messages and executable files to the message queue and execute them as they exit the queue message.
For the handler, two main methods are used: (1) plan messages and executable files that should be executed as some points in the future; and (2) insert an action that must be performed on a thread other than your own.
Indicates that Handler code is executing on the thread to which it belongs.
Veger source share