One of the ways to create the HandlerThread is to subclass it and most of the time you will be using this method.
Understanding Android Core: Looper, Handler, and HandlerThread
Janishar Ali

Hi!! great article. I was searching more about it and found this article with an example:

At the end the author explains why this may not be the best approach and I quote: “Sometimes it will work fine, but sometimes you’ll get NPE at the postTask call stating, that mWorkerHandler is null. You can be a victim of race conditions between two threads (main and background)”. What do you think?

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.