Basic context explanation in android

"If you cannot explain this to a six-year-old child, you yourself do not understand this." - Albert Einstein

After reading the context on the Android developer website and elsewhere on the Internet, I'm still a little fuzzy. In this line of code, I'm a little confused about what the parameter really means. I am not ashamed to receive a 6-year answer ....

TextView textView = new TextView (getBaseContext ());

thanks

+7
source share
4 answers
  • Sea for fish,
  • the sky for the bird
  • bird nest,
  • rabbit hole for rabbit,
  • the space in which javax.swing.JComponent is drawn.

Context is a way of describing the ether / environment in which the entity lives and how to access other materials living in this environment and interact with it.

:) The first attempt at a poetic answer for the stack over the stream;)

At least a 6 year old child will receive the first four analogies.

More pragmatically, we can find another way to conceptualize the context, but it remains that the methods of this interface can offer as a set of services.

+9
source

Context is the bridge through which vehicles move from one place to another. The places here are the components of the application, such as Activity, Receiver, Service, etc ... You can say that this is a means of exchanging information ...

+1
source

Try this answer . This question has been asked several times, so a search for this site may yield some results.

0
source

"Context" freely means the environment in which the object lives. It provides access to other things within this environment. Actions and services inherit the Context class, so you can always access components related to where they work.

0
source

All Articles