In the following scenario, the fields of
Activity is not released when the Activity is closed with calling finish().
Class MyClass
{
}
public MyActivity extends Activity
{
private MyClass obj;
public void onCreate(xxx)
{
........
obj = new MyClass();
}
}
when Activity is closed, the field 'obj' is not released. Certainly, we can add
statement "obj = null" in onDestroy() to release it explicitly, but I'm curious
that other fields of Activity is not released, is there memory leak?
I tried following test:
1, Start Activity A
2, Start Activity B from A with calling startActivity
3, Close Activity B with calling finish();
4, Start Activity B in method onResume() of Activity A
When B is started about 2000 times, Android system report out of memory, it
seems that memory leaks during the processes, how to resolve this issue?
Thanks very much.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en