Android interview prep in 2023 — PART 1

<h2>2. What is Context?</h2> <p>A&nbsp;<strong>Context</strong>&nbsp;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. Context is like a handle to the environment your application is currently running in.<br /> <strong>Application Context:</strong>&nbsp;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 are passing a context beyond the scope of an activity.<br /> <strong>Activity Context:</strong>&nbsp;This context is available in an activity. This context is tied to the lifecycle of an activity. The activity context should be used when you are passing the context in the scope of an activity or you need the context whose lifecycle is attached to the current context.</p> <p><a href="https://levelup.gitconnected.com/android-interview-prep-in-2023-part-1-40e38b2531b"><strong>Read More</strong></a></p>
Tags: Interview prep