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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Denix
September 14, 2017
Programming
49
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
81
Git 教學簡報
denishsieh
0
290
Database 教學簡報
denishsieh
0
72
Other Decks in Programming
See All in Programming
cloudnative conference 2026 flyle
azihsoyn
0
180
AI時代になぜ書くのか
mutsumix
0
400
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2k
Agentic AI & UI: Arcitecture, HITL, Emerging Standards
manfredsteyer
PRO
0
100
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
510
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
1
160
GitHubCopilotCLIをはじめよう.pdf
htkym
0
330
AIを導入する前にやるべきこと
negima
2
360
My daily life on Ruby
a_matsuda
3
380
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
440
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
190
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
140
Git: the NoSQL Database
bkeepers
PRO
432
67k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
820
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
120
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
Raft: Consensus for Rubyists
vanstee
141
7.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
150
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How to build a perfect <img>
jonoalderson
1
5.5k
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