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
56
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
320
你所不知道所得分配的事
denishsieh
0
84
Git 教學簡報
denishsieh
0
310
Database 教學簡報
denishsieh
0
78
Other Decks in Programming
See All in Programming
ソフトウェアラスタライザ
fadis
1
790
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
120
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
170
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
130
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
670
業務時間外もAIに働いてもらう話
colorful12
3
9.9k
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
420
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
140
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
0
360
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
310
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
250
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Balancing Empowerment & Direction
lara
6
1.3k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Invisible Side of Design
smashingmag
301
52k
Unsuck your backbone
ammeep
672
58k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Being A Developer After 40
akosma
91
590k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
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