Android Context

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Per Google documentation: "Interface to global information about an application environment. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc."

More simply put, Context is the current state of your application. It allows you to provide information to objects so that they can be aware of what is going on in other parts of your application.

Syntax

  • getApplicationContext()
  • getBaseContext()
  • getContext()
  • this

Remarks

This StackOverflow page has several comprehensive and well written explanations of the concept of Context:

What is Context?



Got any Android Question?