unfortunately, there's not all text visible on your screenshot. On Stackoverflow, it's generally preferred if you paste the source code directly into your question rather than sharing a screenshot. It's a bit more effort, at the same time, please consider that the people answering your question also take effort to help you - and by posting the source code as text, you make it easier for everyone to help you.
For your question, there's a couple of things that might happen:
channel=value
and channel+="1"
might happen at the same time, which could give you unpredictable results.To solv the problem, you will need to trigger whatever action should happen after your callback at a time when you know that the callback has been called. I am no expert on Android; there might be listeners available for that. If not, then the simplest way would be to call the code that should happen after the callback was called from the callback itself (be aware, that this is most likely a bad practise in android as it might make the UI become unresponsive. To solve that, you will need to execute your code on a different thread than the UI thread)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.