I have a simple Hello World application
public class TestLeaksOnFinish extends Activity
{
static int ctr = 0;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView t = new TextView(this);
t.setText("Hello World! "+ctr++);
setContentView(t);
}
}
When I run this multiple times, each time followed by pressing BACK, I see that ctr increases each time, indicating that the Activity is not killed completely after BACK.
This is also confirmed by dumping the HPROF file in DDMS after pressing BACK.
This file still contains my TestLeaksOnFinish activity class.
Can someone explain why this Activity is still present in the heap dump after pressing BACK?
When I list the incoming references, I get the following