This question concerns memory in Android.
My method:
I have two activites, A and B. From A, I launch B like this:
Intent i =
What i think is, its a typical java question. And killing an Activity does't mean that its associated objects should be removed from the heap
, even if they are in lost land (their reference are null). because its completely dependent on virtual machine when it calls Garbage collector
(Irrespective of you saying System.GC()
). so when there the condition is like nearly out of memory it calls it and cleans it(cannot be sure again, may be immediately after their reference becomes null
), So i don't think you should be worrying about it.
edited:
call setContentView(getApplicationContext);
and where ever you are this
keyword to pass a context, change it to this.getApplicationContext()