Hi all

i have the problem about Activity#finish

my code like

class A1(){
   onclick(){
     startIntent(A1.this, A2.class);
     finish();
   }
}

class A2(){
   private byte[] temp = new byte[3*1024*1024]; //3mb
   onclick(){
     startIntent(A2.this, A1.class);
     finish();
   }
   onDestroy(){
   //do nothing
   }
}

then it will cause outofmemory error after i click button few
times(moving between A1 and A2)

if i add "temp  = null" in A2's onDestroy, then it goes well.
but i dont know why A2's member variable temp didnt garbage collected
after calling finish.(using ddms's cause gc doesnt work,too)


thanks

koji




--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to