七种生命周期
import android.app.Activity; import android.os.Bundle; import android.util.Log; import com.hanqi.test2.R; /** * Created by 吴仪 on 2016/3/16. */ public class Activity2 extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.Activity2); Log.e("TAG","#####创建"); } protected void onStar(){ super.onStart(); Log.e("TAG","#####启动"); } @Override protected void onResume() { super.onResume(); Log.e("TAG", "#####显示"); } protected void onDestory(){ 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","#####重启动"); } }