I use Handler
in conjunction with HandlerThread
all over in my Android project. I use most of them in Services. There, my Handlers backed by an individual HandlerThread with low priority get created in onCreated()
and stopped in onDestroy()
.
Many of them just wait the whole time. E.g. they process stuff for a few seconds each five minutes.
In total my app has about 20 threads (half of them are HandlerThreads). So, is that an performance issue to have so many threads open? In Is it bad to have threads waiting in java? I learnt, that it should be correct. I just want to check, if that applies to HandlerThread
also.