Activity OnDestroy never called?

onDestroy() is called only when the system is low on resources (memory, cpu time, etc) and makes a decision to kill your activity/application or when somebody calls finish() on your activity.

So, to test your code you can make a test button, that will call finish() on your activity.

Read more here.

Also, I believe you don’t need to call all this stuff in onDestroy() until adap is not a critical resource. And even in that case the android system has mechanisms to properly dispose of them.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)