안드로이드 개발 질문/답변
(글 수 358)
BroadcastReceiver 에서 close 관련된 데이터베이스 오류가 떠서
protected void onDestroy() {
super.onDestroy();
if (dbAdapter != null) {
dbAdapter.close();
}
}
다음과 같이 써줬습니다.
그런데 super.onDestroy(); 에 밑줄이 그이며 "The method onDestroy() is undefined for the type BroadcastReceiver" 이런 메시지가 출력 되는데
Receiver에서는 super.onDestory를 사용하는 방법이 따로 있나요?
BroadcastReceiver에는 onDestroy함수가 없습니다.
super는 해당 클래스가 어떤 클래스를 상속 받았을 때
상속받은 부모클래스에 접근할 때 사용됩니다.