Sunday, February 23, 2014

android but did not finish the implementation of onDestroy method, too weird?


This is ActivityDemo.Activity

public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
Log.e (TAG, "start onCreate ~ ~ ~");
context = getApplicationContext ();
Button btn = (Button) findViewById (R.id.btn2);
btn.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
startActivity (new Intent (context, ActivityDemo2.class));
}
});
}

@ Override
protected void onStart () {
super.onStart ();
Log.e (TAG, "start onStart ~ ~ ~");
}

@ Override
protected void onRestart () {
super.onRestart ();
Log.e (TAG, "start onRestart ~ ~ ~");
}

@ Override
protected void onResume () {
super.onResume ();
Log.e (TAG, "start onResume ~ ~ ~");
}

@ Override
protected void onPause () {
super.onPause ();
Log.e (TAG, "start onPause ~ ~ ~");
}

@ Override
protected void onStop () {
super.onStop ();
Log.e (TAG, "start onStop ~ ~ ~");
}

@ Override
protected void onDestroy () {
super.onDestroy ();
Log.e (TAG, "start onDestroy ~ ~ ~");
}
This is ActivityDemo2.activity
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main2);
context = getApplicationContext ();
Log.e (TAG, "start onCreate ~ ~ ~");
Button btn = (Button) findViewById (R.id.btn);
btn.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
startActivity (new Intent (context, ActivityDemo.class));
}
});
}

@ Override
protected void onStart () {
super.onStart ();
Log.e (TAG, "start onStart ~ ~ ~");
}

@ Override
protected void onRestart () {
super.onRestart ();
Log.e (TAG, "start onRestart ~ ~ ~");
}

@ Override
protected void onResume () {
super.onResume ();
Log.e (TAG, "start onResume ~ ~ ~");
}

@ Override
protected void onPause () {
super.onPause ();
Log.e (TAG, "start onPause ~ ~ ~");
}

@ Override
protected void onStop () {
super.onStop ();
Log.e (TAG, "start onStop ~ ~ ~");
}

@ Override
public void onDestroy () {
super.onDestroy ();
Log.e (TAG, "start onDestroy ~ ~ ~");
}
Jump to each other how will execute onDestroy ();
This is the information printed, seeking to explain ah?
09-13 17:09:58.882: E/ActivityDemo2 (2074): start onPause ~ ~ ~
09-13 17:09:58.937: E / ActivityDemo (2074): start onCreate ~ ~ ~
09-13 17:09:58.937: E / ActivityDemo (2074): start onStart ~ ~ ~
09-13 17:09:58.945: E / ActivityDemo (2074): start onResume ~ ~ ~
09-13 17:09:59.390: E/ActivityDemo2 (2074): start onStop ~ ~ ~
09-13 17:09:59.406: E/ActivityDemo2 (2074): start onDestroy ~ ~ ~
09-13 17:10:00.437: E / ActivityDemo (2074): start onPause ~ ~ ~
09-13 17:10:00.500: E/ActivityDemo2 (2074): start onCreate ~ ~ ~
09-13 17:10:00.500: E/ActivityDemo2 (2074): start onStart ~ ~ ~
09-13 17:10:00.500: E/ActivityDemo2 (2074): start onResume ~ ~ ~
09-13 17:10:00.515: D / dalvikvm (2074): GC_CONCURRENT freed 404K, 11% free 7493K/8391K, paused 3ms +5 ms, total 27ms
09-13 17:10:00.929: E / ActivityDemo (2074): start onStop ~ ~ ~
09-13 17:10:00.945: E / ActivityDemo (2074): start onDestroy ~ ~ ~

<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
I tried Click Button to jump each other, does not call onDestroy () ah.

Press the BACK button to return before calling onDestroy ()

Reply:
It recovered by the system
Reply:
reference to the second floor wawyz reply:
been systematically collected it

It recovered by the system
Reply:
Is recovered by the system
Reply:
Recommendations refer to the post http://bbs.csdn.net/topics/360202140
Reply:
Jump From A B, A will call destroy method from B and then jump back to A, B will call the destroy method
Reply:
After the program as long as onPause, are likely to be recovered out of the system, often see the log, *** killed too many background like
Reply:
Later, they do not know why it
Reply:
lz using a Samsung phone, and see this post
http://blog.csdn.net/jason_wks/article/details/9248627

No comments:

Post a Comment