Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Learning Android
Search
Denix
September 14, 2017
Programming
48
0
Share
Learning Android
CMRDB Android 讀書會, 2014 Winter
Denix
September 14, 2017
More Decks by Denix
See All by Denix
Android_Scalable_Modularized_Testable_Architecture.pdf
denishsieh
0
300
你所不知道所得分配的事
denishsieh
0
77
Git 教學簡報
denishsieh
0
280
Database 教學簡報
denishsieh
0
70
Other Decks in Programming
See All in Programming
The free-lunch guide to idea circularity
hollycummins
0
400
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
100
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
AI 開発合宿を通して得た学び
niftycorp
PRO
0
190
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
130
Coding as Prompting Since 2025
ragingwind
0
650
KagglerがMixSeekを触ってみた
morim
0
360
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
150
20260315 AWSなんもわからん🥲
chiilog
2
180
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
180
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.2k
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
510
The Curse of the Amulet
leimatthew05
1
11k
エンジニアに許された特別な時間の終わり
watany
106
240k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
150
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
500
YesSQL, Process and Tooling at Scale
rocio
174
15k
HDC tutorial
michielstock
1
600
The Invisible Side of Design
smashingmag
302
51k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
The Pragmatic Product Professional
lauravandoore
37
7.2k
Context Engineering - Making Every Token Count
addyosmani
9
790
Transcript
CMRDB 靜宜大學行雲者研發基地 與使用者互動- 事件處理 謝宗翰 Android 讀書會 2014 Winter
2 事件處理機制 button 產生onClick 事件 program
3 來源與監聽物件 ◎來源物件 Ø 事件發生的來源(ex: 按鈕) ◎監聽物件(Listener) Ø 處理該事件 Ø
先登錄à來源物件
4 Interface of Java ◎要成為特定事件的Listener, 必須符合該事 件的規範。 Ø Android à
Interface ü 介面Interface != 使用者介面UI
5 Interface of Java ◎介面(附錄A-20) Ø 一份method的『規格書』 ü 方法的名稱 ü
方法的參數 ü 方法的回傳值 介面 I 類別 C implements 類別 C 具有 介面 I 的功能 methods ….名稱 ….參數 ….回傳值 methods ….內容
6 Implement ◎撰寫符合該介面的method Ø 按一下 onClick() ? ü 在OnClickListener介面已定義 ◎向來源登錄自己成為該事件的Listener
7 Implement public class MainActivity extends Activity implements OnClickListener{ …
protected void onCreate(…){ … Button btn= findViewById(…); btn.setOnClickListener(this); } public void onClick(View v){ … } } 可處理『按一 下』事件 撰寫『按一下』 事件處理方法 取得按鈕 物件 以this向 btn登錄 button 登錄 呼叫
8 The End