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
0
47
Learning Android
CMRDB Android 讀書會, 2014 Winter
Denix
September 14, 2017
Tweet
Share
More Decks by Denix
See All by Denix
Android_Scalable_Modularized_Testable_Architecture.pdf
denishsieh
0
290
你所不知道所得分配的事
denishsieh
0
72
Git 教學簡報
denishsieh
0
270
Database 教學簡報
denishsieh
0
69
Other Decks in Programming
See All in Programming
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.1k
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
840
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1k
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
260
組織で育むオブザーバビリティ
ryota_hnk
0
170
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
Oxlint JS plugins
kazupon
1
820
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
0
350
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
820
Git: the NoSQL Database
bkeepers
PRO
432
66k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
72
Embracing the Ebb and Flow
colly
88
5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Exploring anti-patterns in Rails
aemeredith
2
250
Utilizing Notion as your number one productivity tool
mfonobong
3
220
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
410
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
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