public void onDestroy() {
}
protected void finalize() {
}
Does finalize not always get called for fragments?
What about the fields that are inside of the fragment instance? Must I set them to null in onDestroy
so that they are reclaimed?
public void onDestroy() {
}
protected void finalize() {
}
Does finalize not always get called for fragments?
What about the fields that are inside of the fragment instance? Must I set them to null in onDestroy
so that they are reclaimed?
My understanding is that the finalize method is called by the garbage collector and cannot be relied upon to be called at a given time.
These posts may give you more insight:
I tend to do my cleanup in onPause or onDestroy.