Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialsahil shokeen
1,579 PointsContext
here when we start new activity we create object of intent class but i am not able to understand this context concept....please explain!!
3 Answers
James Simshaw
28,738 PointsHello,
One of the ways I see the Context is what is holding everything, displaying it, and tracking its state. For myself, that tends to almost always be an Activity. This works since Activity is a descendent of the Context class. Your application as a whole is another context.
sahil shokeen
1,579 Pointsthen what is the difference b/w context class and object class???
James Simshaw
28,738 PointsOne way to look at that is that all Contexts are Objects, but not all Objects are Contexts. For example, a View is a type of Object, but it is not a type of Context. In other words, the Context class is a descendent of the Object class. Since Activities are a descendent of the Context class, Activities are also a descendent of the Object class(in fact almost everything in Java is a descendent of the Object class).