ApplicationContext is private implementation.  Activity takes care of the
startActivity implementation for itself, since it wants the starting
activity to be associated with the original activity (and ApplicationContext
is just the most generic context, which doesn't know that it is an
activity).

On Tue, Sep 29, 2009 at 12:49 AM, amit <[email protected]> wrote:

>
> hi,
>
> I was going through the code for Activity.java and ApplicationContext.
>
> Both these classes define many functions of Context Interface. Take
> for example startActivity.java
>
> Activity Class has its own implementation of startActivity
> ApplicationContext class also has an implemenetaion of startActivity.
>
>
> Now there are 2 observations...
>
> Observation 1: Regarding ApplicationContext.java
>
> ====================
> /**
>  * Common implementation of Context API, which Activity and other
> application
> * classes inherit.
>  */
> @SuppressWarnings({"EmptyCatchBlock"})
> class ApplicationContext extends Context {
> ===================================
>
> So the comments imply that Activity class should actually use
> ApplicaitonContext.java. Infact Activity Class should inherit
> ApplicationContext class.
>
> Observation 2: Regarding Activity.java
>
> But if you look at class Hierarchy of Activity class, it goes as:
>
> Context ==> ContextWrapper ==> ContextThemeWrapper ==> Activity
>
> So nowhere do I find ApplicationContext.
>
>
> Questions:
> 1. Who uses ApplicationContext class?
> 2. Does Activity class ever deal with ApplicationContext class (as
> given in the javadoc comments of ApplicationContext.java).
>
> Thanks,
> Amit
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to