The problem here is that, onDestroy() callback is not guaranteed to be called by the system, which…
Viraj Tank
11

onDestroy() callback is not guaranteed to be called by the system

I think you’re misunderstanding what that means: it’s not guaranteed to be called because the process might die before that, so it’s not a good place to save data. In this case you only care about cleaning up resources, so that will be taken care of automatically.