protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toast.makeText(getApplicationContext(), "onCreate()", Toast.LENGTH_SHORT).show();
}
@Override
protected void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
Toast.makeText(getApplicationContext(), "onDestroy()", Toast.LENGTH_SHORT).show();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
Toast.makeText(getApplicationContext(), "onPause()", Toast.LENGTH_SHORT).show();
}
@Override
protected void onRestart() {
// TODO Auto-generated method stub
super.onRestart();
Toast.makeText(getApplicationContext(), "onRestart()", Toast.LENGTH_SHORT).show();
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
Toast.makeText(getApplicationContext(), "onResume()", Toast.LENGTH_SHORT).show();
}
@Override
protected void onStart() {
// TODO Auto-generated method stub
super.onStart();
Toast.makeText(getApplicationContext(), "onStart()", Toast.LENGTH_SHORT).show();
}
@Override
protected void onStop() {
// TODO Auto-generated method stub
super.onStop();
Toast.makeText(getApplicationContext(), "onStop()", Toast.LENGTH_SHORT).show();
}
7가지의 생명주기를 눈으로 확인해 볼 수 있다.
onDestroy 는 finish 하여야 종료가 된다.
'개발자 > Android' 카테고리의 다른 글
Android 사칙연산 계산기 소스 (2) | 2013.02.14 |
---|---|
안드로이드 Locat 에 text 출력하기 (0) | 2013.02.14 |