I have a thread running showing some stuff, but there is also a onTouch event, what I want to do is to lock the OnTouch while the other Thread is running and when it is done then allow the OnTouch to work again..?
How can I achieve this?
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.
I would use a flag that indicates if a thread is running. Then you can do this in your onTouch method:
And in your thread you can set the flag in the run method:
As soon as your thread is finished, you set the flag back to false: