What is the difference between getContext()
, getApplicationContext()
, getBaseContext()
, and "this
"?
Though this is simple question I am unable to understand the basic difference between them. Please give some easy examples if possible.
What is the difference between getContext()
, getApplicationContext()
, getBaseContext()
, and "this
"?
Though this is simple question I am unable to understand the basic difference between them. Please give some easy examples if possible.
Context
provides information about theActvity
orApplication
to newly created components.Relevant
Context
should be provided to newly created components (whether application context or activity context)Since
Activity
is a subclass ofContext
, one can usethis
to get that activity's contextA piece of UML diagram of Context