onDestroy() is called only when system is low on resources(memory, cpu time and so on) 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][1].
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 android system has mechanisms to properly dispose them.
Its already answered [here][2]
[1]: http://developer.android.com/reference/android/app/Activity.html#onDestroy%28%29
[2]: https://stackoverflow.com/questions/4449955/activity-ondestroy-never-called
onDestroy() is called only when system is low on resources(memory, cpu time and so on) 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.
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 android system has mechanisms to properly dispose them.
For More Details you can Refer [Here][1]
[1]: http://developer.android.com/reference/android/app/Activity.html#onDestroy%28%29