-1

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?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Adnan Pirota
  • 299
  • 5
  • 25
  • 1
    No.[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
  • 1
    No. `Activity` extends `Context`. Please see the Activity documentation. – Simon Oct 24 '13 at 18:05

1 Answers1

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