If the inner class is not static it cannot be instantiated except
within the context of an instance of the containing class.

so you cannot say "new MyInner()" or something like that.

instead you have to do "myOuterInstance.new MyInner()" to instantiate
it.

Since the framework does not have an instance of the outer containing
class it cannot construct a non static inner class.

On Oct 2, 1:31 pm, sdphil <[email protected]> wrote:
> so is there a way in the outer class to get access to that Service
> object?
>
>         context.startService( new Intent(context, UpdateService.class) );
>
> to start the service, but then how do i get a reference to the
> UpdateService object that it indirectly creates?
>
> On Oct 2, 1:17 pm, Dianne Hackborn <[email protected]> wrote:
>
> > This is true, because the system will launch the service as needed, outside
> > of the environment of whatever the container class is.  All of the items in
> > the manifest are top-level components, owned by the application itself, not
> > some other class in it.
>
> > On Fri, Oct 2, 2009 at 1:10 PM, sdphil <[email protected]> wrote:
>
> > > looking at this example --
>
> > >http://android-developers.blogspot.com/2009/04/introducing-home-scree...
>
> > > if the inner UpdateService class is not static, it cannot start the
> > > service.  The ActivityManager complains "Unable to start service
> > > Intent"...
>
> > > any ideas why?
>
> > > tia.
>
> > --
> > 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