package com.hanpang.activitylife;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
System.out.println("創(chuàng)建");
}
@Override
protected void onStart() {
super.onStart();
System.out.println("開始");
}
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
System.out.println("銷毀");
}
@Override
protected void onPause() {
super.onPause();
System.out.println("暫停");
}
@Override
protected void onResume() {
super.onResume();
System.out.println("運(yùn)行");
}
@Override
protected void onRestart() {
super.onRestart();
System.out.println("重啟");
}
}
重寫了上述的七個(gè)方法,我們進(jìn)行測(cè)試