Let's say we have a reference (strong reference) to an activity object.
What happens to Activity object after it was:
- finished or
- changed orientation or
- put on pause or stopped because of switch to another activity
I am talking about a case when application wasn't killed by OS but when a user continue to use the application.
Will activity ever be released, if we continue to keep this strong reference? One one hand, as I understand, if somebody keeps a reference to an object it can't be released/deallocated. On other hand, Android is quite aggressive with releasing unused activity and I wonder whether Dalvik machine has some exception which will allow to release/deallocate an activity which is referenced.
These article doesn't talk directly about a case, when somebody is keeping a reference: http://developer.android.com/training/basics/activity-lifecycle/starting.html#Destroy http://developer.android.com/reference/android/app/Activity.html
There is only one hint which I got:
There is a method Activity.isDestroyed() which kind of implies that object won't go away immediately.