method의 첫글자는 소문자가 습관이 되어


button.setOnLongClickListener(
new Button.onLongClickListener(){
public boolean onLongClick(View v){
TextView statusText = (TextView)findViewById(R.id.statusText);
statusText.setText("Button Long clicked");
return true;
}
}
);

 

버튼의 롱~클릭 이벤트를 정의했는데... 문제가 있다고 한다.



button.setOnLongClickListener(
new Button.OnLongClickListener() {
public boolean onLongClick(View v) {
TextView statusText =
(TextView)findViewById(R.id.statusText);
statusText.setText("Long button click");
return false;
}
}
);

자세히 보면 Button의 Long Click EventListener의 On 은 대문자다 ㅡㅡ;

Listener 내 method는 onLongClick 로 소문자인데...


ㅋㅋ 알보고면 Listener는 Class이고 기본생성자인 것이다...

괄호가 있다고 method라고 착각했던...


728x90
BLOG main image
"그게 뭐 어쨌다는 거냐?" 늘 누가 나에게 나에대한 말을할 때면 이말을 기억해라. by nobang

카테고리

nobang이야기 (1932)
Life With Gopro (7)
Life With Mini (79)
Diary (971)
너 그거 아니(do you know) (162)
난 그래 (158)
Study (290)
속지말자 (10)
Project (34)
Poem (15)
Song (0)
Photo (113)
낙서장 (45)
일정 (0)
C.A.P.i (2)
PodCast (0)
nobang (27)
고한친구들 (4)
recieve (0)
History (0)
android_app (2)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :