1

I have an Activity where I have one static variable of type Activity. In oncreate() method, the activity instance is set to the static vairable.

I want to know how long the activity instance will remain in memory if that instance is set as a static variable. And when will garbage collector run on the this activity instance and its view objects.

As far as I know , Static variable gets loaded when class is loaded by ClassLoader, and would be removed when it is Unloaded. So does this mean that the activity/view instance will remain in memory till OS kills the process.

4

0 回答 0