In android , Handler can be used to post / handle message, if I don't use a HandlerThread (pass its Looper to Handler), does that mean in this case Handler use MainThread (UI Thread) 's Looper ?
What result will get if Handler uses MainThread's Looper ? May cause mainThread blocked ?
You would use HandlerThread in case that you want to perform background tasks one at a time and you want that those tasks will run at the order of execution.
For example if you want to make several network background operations one by one.
Yes, the HandlerThread has it's own looper and handlers could be created and post it, (so it would not block the main thread).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With