getApplicationContext(), getBaseContext(), getApplication(), getParent()

android, android-context

Solution

`getApplicationContext()` Application context is associated with the Application and will always be the same throughout the life cycle.

`getBasecontext()` should not be used, just use `Context` instead of it which is associated with the activity and can be destroyed when the activity is destroyed.

Problem

What is the difference between: - `getApplicationContext()` - `getBasecontext()` - `getApplication()` - `getParent()` Can you elaborate with one simple example?

Original source

Related problems