$30 off During Our Annual Pro Sale. View Details »
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
280
你所不知道所得分配的事
denishsieh
0
71
Git 教學簡報
denishsieh
0
260
Database 教學簡報
denishsieh
0
66
Other Decks in Programming
See All in Programming
開発に寄りそう自動テストの実現
goyoki
1
780
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.2k
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
110
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
120
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.3k
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
370
Go コードベースの構成と AI コンテキスト定義
andpad
0
120
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
関数実行の裏側では何が起きているのか?
minop1205
1
680
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
7k
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
260
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Building an army of robots
kneath
306
46k
GitHub's CSS Performance
jonrohan
1032
470k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
BBQ
matthewcrist
89
9.9k
Facilitating Awesome Meetings
lara
57
6.7k
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