What is Android Context and why is it needed?

Possible duplicate:
What is the context in Android?

I would like to know what the Android Context is and why it is needed. I know this is related to the class, and each class has a unique context. I saw in some code that passes context when calling methods of another class. I do not understand why this is necessary. Please help.

+6
android android-context
source share
3 answers

a Context:

Interface to global information about the application environment. This is an abstract class whose implementation is provided by the Android system. This allows you to access specific applications of resources and classes, as well as forwarding at the application level such operations as launching activities, broadcasting and receiving intentions, etc.

Link: http://developer.android.com/reference/android/content/Context.html

+1
source share

All classes do not have an android context. This is the application context and activity context c. Context is used for many things, but more often itโ€™s just loading and accessing resources.

See http://developer.android.com/reference/android/content/Context.html for details.

+1
source share

The android context contains information about your application environment.

Perhaps you should take a look at the official reference to understand what information is stored in your context and what operations you can do with it.

0
source share

All Articles