生命周期
package com.kankanla.m20190711m_recorder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends AppCompatActivity {
private final String T = "### MainActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.i(T, "1 onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
protected void onStart() {
Log.i(T, "2 onStart");
super.onStart();
}
@Override
protected void onResume() {
Log.i(T, "3 onResume");
super.onResume();
}
@Override
protected void onPostResume() {
Log.i(T, "4 onPostResume");
super.onPostResume();
}
@Override
protected void onPause() {
Log.i(T, "5 onPause");
super.onPause();
}
@Override
protected void onStop() {
Log.i(T, "6 onStop");
super.onStop();
}
@Override
protected void onDestroy() {
Log.i(T, "7 onDestroy");
super.onDestroy();
}
@Override
protected void onRestart() {
Log.i(T, "8 onRestart");
super.onRestart();
}
}