i have a class that starts new threads, and they use a handler to write a an array in the ui thread,they are thread safe.
What if i start those threads from a timer task, are they still threadsafe with the ui thred?
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the
Handlerobjects are bound to the UI thread, it is safe to update the array in theHandler(assuming that the array is also bound to the UI thread).Check the
Handlerdocumentation, especially this part:It states that the
Handlercode is executed on the thread it belongs to.