package com.example.administrator.myapplication; import android.app.Activity; import android.os.Bundle; import android.util.Log; /** * Created by Administrator on 2016/3/18. */ public class Activity2 extends Activity{ @Override//创建 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.activity2); // System.out.println("这是我运行的第一个Activity"); // Log.v("test", "Log输出的信息"); // Log.i("test", "Log输出的信息"); // Log.d("test", "Log输出的信息"); // Log.w("test", "Log输出的信息"); // Log.e("test", "Log输出的信息"); Log.e("TAG", "#######创建"); } @Override//启动 protected void onStart() { super.onStart(); Log.e("TAG", "#######启动"); } @Override//显示,可以与用户交互 protected void onResume() { super.onResume(); Log.e("TAG", "#######显示"); } @Override//关闭 protected void onDestroy() { super.onDestroy(); Log.e("TAG", "#######关闭"); } @Override//暂停 protected void onPause() { super.onPause(); Log.e("TAG", "#######暂停"); } @Override//停止 隐藏起来不和用户交互 protected void onStop() { super.onStop(); Log.e("TAG", "#######停止"); } @Override//重启动 protected void onRestart() { super.onRestart(); Log.e("TAG", "#######重启动"); } } //onDestroy()销毁,销毁onStop状态的内存