Reputation:
Why use Looper/Handler when I could use an Executor method(s)?
The Looper/Handler duo seems rather clunky and doesn't seem to do a great deal beyond allowing the queuing of runnables and seemingly has less flexibility.
What was the looper design rationale?
Thanks.
Upvotes: 2
Views: 2134
Reputation: 35234
A looper by itself does not have many advantages over an executor. It is how Android manages worker. But you are able to get the main thread of your app with Looper.getMainLooper()
, this can have the following advantages:
Upvotes: 2