Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
What The Context ?
Search
Adnan A M
April 11, 2020
Programming
240
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
What The Context ?
Slides from my talk at BLRDroid
Adnan A M
April 11, 2020
More Decks by Adnan A M
See All by Adnan A M
Abridge Coding Guidelines
adnan321
0
86
A developer's guide to wealth
adnan321
0
300
What the Hook ?
adnan321
0
110
Scoping Your Storage
adnan321
2
190
Putting Work Manager To Work
adnan321
0
120
OOP To FP
adnan321
1
230
Putting Work Manager To Work
adnan321
1
210
A slice of Android Slices - droidcon London 2018
adnan321
0
130
Having fun with Kotlin fun()
adnan321
0
130
Other Decks in Programming
See All in Programming
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
130
XHTMLが残したもの
yosuke_furukawa
PRO
2
810
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
290
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
160
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
Heart of Swift Concurrency
koher
0
880
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
320
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
560
すこし踏み込む CancellationToken
htkym
0
280
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
350
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4.7k
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
280
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Odyssey Design
rkendrick25
PRO
2
810
Amusing Abliteration
ianozsvald
1
300
Embracing the Ebb and Flow
colly
88
5.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
380
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Mind Mapping
helmedeiros
1
360
The SEO identity crisis: Don't let AI make you average
varn
0
560
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