Context in Android
What is Context? A Context provides access to information about the application state. It provides Activities, Fragments, and Services access to resource files, images, theme/styles, and external directory locations. It also enables access to Android's built-in services, such as those used for layout inflation, keyboard, and finding content providers. What is a Context used for? Explicitly starting a component (activity and services) Creating a View Sending a broadcast Retrieving a System Service Access to information about the application state Application Context It is an instance which is the singleton and can be accessed in an activity via getApplicationContext(). This context is tied to the lifecycle of an application. The application context can be used where you need a context whose lifecycle is separate from the current context or when you a...