-4

As a newbie I am trying to make an app thorough watching some tutorials. I am approaching further and getting more and more confused about "Context". About its definition as well as its contribution. Most puzzling part is when to put the "context" as a parameter.

Which types of classes take "context" as parameter? What can/should I suppose to do with it?

Nirmal
  • 3
  • 4

1 Answers1

1

Couldnt explain it better:

"Context allows access to application-specific resources and classes, as well as calls for application-level operations such as launching activities, broadcasting and receiving intents, etc. Context in Android is an interface to global information about an application environment." - From one of the thread in stack overflow".

"Context is context of current state of the application/object.Its an entity that represents various environment data . Context helps the current activity to interact with out side android environment like local files, databases, class loaders associated to the environment, services including system-level services, and more. A Context is a handle to the system . It provides services like resolving resources, obtaining access to databases and preferences, and so on. An android app has activities. It’s like a handle to the environment your application is currently running in. The activity object inherits the Context object."

2D3D
  • 353
  • 1
  • 6
  • 22