일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- border-box
- #2차원배열
- relative path
- mac terminal command
- #3차원배열
- docker example
- html id
- #자바상속#자바이즈어#is~a
- hyperledger transaction
- #다차원포인터
- #성적관리프로그램
- html object
- html charset
- #android activity
- #C++ 연산자함수오버로딩
- #bubbleSort
- html youtube
- html video
- git flow
- #JAVASCRIPT
- 하이퍼레저패브릭
- 토큰경제
- html plug-in
- html code
- html multimedia
- html5 new tag
- #CallByAddress
- #1차원배열
- #C++ has~a
- #binary
Archives
- Today
- Total
A sentimental robot
익명클래스를 이용해서 이벤트리스너 만들기 본문
View.OnClickListener on=new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "hihi", Toast.LENGTH_SHORT).show();
}
};
Button button01=findViewById(R.id.button01);
button01.setOnClickListener(on);
Button button01=findViewById(R.id.button01);
button01.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this, "hihA", Toast.LENGTH_SHORT).show();
}
});
((Button) findViewById(R.id.button01)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
'Android Studio' 카테고리의 다른 글
ListView (0) | 2018.01.29 |
---|---|
Spinner (0) | 2018.01.29 |
LinearLayout (0) | 2018.01.12 |
메소드를 공유하는 위젯 (0) | 2018.01.12 |
안드로이드를 시작하기 전에.. (0) | 2018.01.11 |