In general term,

Context is the information surrounding the information. Without context, information can be misinterpreted; with context, information can be understood.

Context is a much-needed assistant, helping readers define unknown words and make sense of outside information.

IN android world,

Context represents environment data.

It provides access to things such as databases.

typically you call it to get information regarding another part of your program.

The Context class is an “Interface to global information about an application environment”.

Different invoking methods by which you can get context

  1. getApplicationContext()
  2. getContext()
  3. getBaseContext()
  4. this (when in the activity class) (“this” is the keyword of java and it refers to the context of the current activity)
     TextView TV=new TextView(this);

 

 

Advertisements