CopyPastor

Detecting plagiarism made easy.

Score: 0.9187063653607014; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2016-05-04
by Sanjay Kakadiya

Original Post

Original - Posted on 2013-05-15
by Nandu



            
Present in both answers; Present only in the new answer; Present only in the old answer;

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

        
Present in both answers; Present only in the new answer; Present only in the old answer;