NOTE: This is a general answer will cover all the scenarios including yours
Well in general practice, you need to free up resources that are bound to your task, to be more precise Non-preemptive
resources, it is considered to be best practice but, to remove the worker thread from the pool isn't extremely crucial nowadays, In short, for your answer
- If you want to employ best practices you can do that
- If you don't then when the application closes
Garbage Cleaner
will do your task for you when there will be a need of resources, or when the cleanup is scheduled
When to Clean Resources or Close worker Threads
- When you want to close the application
- When you need other tasks and you know that that task will take up a lot of resources and to make your application efficient you really wanted to do that.
- When you want to Leave your application
onPause()
, your application for a moment (considered to be best practice but most developers don't do that, because some times, those process may take more resources on restarting because of a bundle processing[many processes may start on onStart()
])
for your question's answer, I hope the above statement might clarify everything.