I see a lot examples in code were we see the next thing:
HandlerThread thread = new HandlerThread("Thread1");
thread.start();
mLoadHandler = new Handler(thread.getLooper())
mLoadHandler.post(new Runnable() {
public void run() {
// run some code
//methodA();
}
});
you can find it also in:
Why they create a HandlerThread for only one purpose: to pass it's Looper to a new Handler. Why don't just extend the HandlerThread and do the all code (methodA()) there? OR create a Handler instance and call there to:
Looper.prepare();
Looper.loop();
With only the code you show, there is not much difference in dealing with HandlerThread either way.
However, if there are lots of different components all trying to post different Runnables to the same thread, you'd rather not cram all their logic into one class. It's easier in this case to pass around a Handler for these different components to share. This is one scenario, but there could be others.