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
What The Context ?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Adnan A M
April 11, 2020
Programming
2
230
What The Context ?
Slides from my talk at BLRDroid
Adnan A M
April 11, 2020
Tweet
Share
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
64
A developer's guide to wealth
adnan321
0
270
What the Hook ?
adnan321
0
92
Scoping Your Storage
adnan321
2
180
Putting Work Manager To Work
adnan321
0
110
OOP To FP
adnan321
1
210
Putting Work Manager To Work
adnan321
1
180
A slice of Android Slices - droidcon London 2018
adnan321
0
120
Having fun with Kotlin fun()
adnan321
0
98
Other Decks in Programming
See All in Programming
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1k
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.2k
SourceGeneratorのマーカー属性問題について
htkym
0
200
Understanding Apache Lucene - More than just full-text search
spinscale
0
130
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
110
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
130
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
350
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
170
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
490
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
300
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
1
3.1k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
410
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
150
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How GitHub (no longer) Works
holman
316
150k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
270
We Have a Design System, Now What?
morganepeng
55
8k
Building Adaptive Systems
keathley
44
3k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
780
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
79
Transcript
W at he on ex B d 1
Context ?!?? C nt xt s ur m gi !
— Adnan A M B d 2
W y o n ed on ex ? ✴ g
u () ✴ g t () ✴ g e c () ✴ g () ✴ s X() -> S n c n (A y, S , B s e ) B d 3
Types of Context ✴ A t C ✴ A y
C ✴ B C ✴ T C ✴ t ✴ t B d 4
A tu l yp s f on ex ✴ U
C ✴ N -U C B d 5
Understanding the Hierarchy Context | Context Wrapper +-----------+---------+ | |
| Application Service ContextThemeWrapper | Activity B d 6
Understanding the Hierarchy ✴ C /C W ---> o C
✴ C T a -> C = C + T B d 7
UI Context Context + Your Theme B d 8
UI Context ✴ A y - i (I e a
y) ✴ F t - g e () ✴ V - g e () B d 9
Non UI Context ✴ A y - g i C
() ✴ S - g i C () / i (I e s ) ✴ C - g i C () ✴ B s R r - C p B d 10
Does it Matter ? My functionality works fine with either
\0/ B d 11
Which Context to Use ? B d 12
Application Context ✴ S o I e w h m
p ✴ g i C () ✴ N C (L L ) B d 13
Activity/Service Context ✴ U I e e a y/s ✴
t ✴ A y C - C ✴ S C - o C B d 14
Broadcast Receiver Context ✴ U I e e c ✴
c p a t ✴ N C ✴ Y e a R r c t w a r r e () n b v () d d B d 15
Base Context ✴ T d e i n h C
✴ C e l c ✴ C o d u a a e () h C W B d 16
getContext() It Depends \0/ B d 17
What #1 !!! ??? val intent = Intent(this, TestActivity::class.java) applicationContext.startActivity(intent)
B d 18
What #2 !!! ??? class SimpleSingleton { private static SimpleSingleton
sInstance; private Context mContext; public static SimpleSingleton getInstance(Context context) { if (sInstance == null) { sInstance = new SimpleSingleton(context); } return sInstance; } private SimpleSingleton(Context context) { mContext = context; } } B d 19
What #3 !!! ??? LayoutInflater.from(applicationContext).inflate( R.layout.progress_bar, parent, false ) B
d 20
Oh Wow #1 !!! val contextThemeWrapper = ContextThemeWrapper(this, R.style.YOUR_THEME) val
builder = AlertDialog.Builder(contextThemeWrapper) builder.show() B d 21
Sidenote val contextThemeWrapper = ContextThemeWrapper(this, R.style.YOUR_THEME) getBaseContext() ---> Returns instance
of this B d 22
Oh Wow #2 !!! val configuration = resources.configuration configuration.setLocale(your_custom_locale) context
= createConfigurationContext(configuration) B d 23
Oh Wow #3 !!! LayoutInflater.from(applicationContext).inflate( R.layout.progress_bar, parent, false ) B
d 24
Deciding Between UI & Non UI Context ✴ D o
e a r s ? --> C ✴ L L o O o --> o C ✴ N r ? --> B t o C B d 25
References ✴ W C S I s - l M
a ✴ M n A C - G K ✴ C , a C - v S B d 26
T an Y u ! B d 27