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
44
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
260
你所不知道所得分配的事
denishsieh
0
67
Git 教學簡報
denishsieh
0
250
Database 教學簡報
denishsieh
0
64
Other Decks in Programming
See All in Programming
Deep Dive into Kotlin Flow
jmatsu
1
310
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
500
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
520
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
310
複雑なドメインに挑む.pdf
yukisakai1225
5
1.1k
Design Foundational Data Engineering Observability
sucitw
3
190
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
670
個人軟體時代
ethanhuang13
0
320
AIコーディングAgentとの向き合い方
eycjur
0
270
アセットのコンパイルについて
ojun9
0
120
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
420
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
840
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Git: the NoSQL Database
bkeepers
PRO
431
66k
The World Runs on Bad Software
bkeepers
PRO
70
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Being A Developer After 40
akosma
90
590k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Site-Speed That Sticks
csswizardry
10
810
It's Worth the Effort
3n
187
28k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Bash Introduction
62gerente
615
210k
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