package com.example.lm.myapplication;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class MainActivity extends ActionBarActivity {
//String TAG ="myTag";
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
//Log.d(TAG, "执行了onCreate()方法");
}
@Override
protected void onStart() {
super.onStart();
//Log.d(TAG, "执行了onStart()方法");
}
@Override
protected void onResume() {
super.onResume();
//Log.d(TAG, "执行了onResume()方法");
}
@Override
protected void onPause() {
super.onPause();
//Log.d(TAG, "执行了onPause()方法");
textView.setText("pause");
}
@Override
protected void onStop() {
super.onStop();
//Log.d(TAG, "执行了onStop()方法");
}
@Override
protected void onRestart() {
super.onRestart();
//Log.d(TAG, "执行了onRestart()方法");
}
@Override
protected void onDestroy() {
super.onDestroy();
//Log.d(TAG, "执行了onDestroy()方法");
}
}