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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
71
Git 教學簡報
denishsieh
0
270
Database 教學簡報
denishsieh
0
68
Other Decks in Programming
See All in Programming
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
700
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Basic Architectures
denyspoltorak
0
660
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
650
Implementation Patterns
denyspoltorak
0
280
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
ThorVG Viewer In VS Code
nors
0
770
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
Fragmented Architectures
denyspoltorak
0
150
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
6.9k
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
0
53
How to train your dragon (web standard)
notwaldorf
97
6.5k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
200
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
190
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
Code Review Best Practice
trishagee
74
20k
Speed Design
sergeychernyshev
33
1.5k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
New Earth Scene 8
popppiees
1
1.5k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
410
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
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