Something I am not sure if I got it right or not, can one class let say which extends activity have more than one context or not ? If yes, how?
Asked
Active
Viewed 97 times
-1
-
1No.[See this answer](http://stackoverflow.com/questions/18704228/is-there-any-difference-between-activityname-this-this/18704355#18704355) and the linked answer in it for a better understanding. There is `Application Context` but it isn't associated with the `Activity`. See the link for a better understanding of the differences. – codeMagic Oct 24 '13 at 18:01
-
1No. `Activity` extends `Context`. Please see the Activity documentation. – Simon Oct 24 '13 at 18:05
1 Answers
1
A class that extends Context
is a context
, and it can only be one, but it may hold references to other contexts as well, for example, by retrieving the application context by calling getApplicationContext()
.

MByD
- 135,866
- 28
- 264
- 277