I want my executor to run up until my service is not running anymore.
The logical solution I think of is to do executor.shutdown()
on the service's onDestroy()
What would be the consequences of that action?
I know when I kill an app it's services doesn't guarantee to go through onDestroy()
, hence the executor will never preform a shutdown()
If the service is a foreground service, will it solve that issue? And anyhow is it the right way to work?
General Info of what im trying to do - I intend to access a method on my service that will change/add tasks to the executor. I need it to act as a "listener
" up until I don't use the service anymore, thats why I cant just shut it down at any other place rather then the onDestroy()
.