To be honest, I wouldn't expect a service that is not started to
receive anything.  This is the same expectation that I would have
about  an activity that has not yet been created or has been
destroyed.

I would expect, however, a broadcast receiver registered in my
manifest to receive valid intents for which the app holds permission,
and I would expect that broadcast receiver be able to start a service
if needed.

Doug

On Jan 23, 9:30 pm, Ravi Pandey <[email protected]> wrote:
> I have tried to design a Service in such a way that once it's receiver
> can receive the BOOT_COMPLETED intent , the service gets started.
> Basically the startService() function gets called when the Service's
> BroadCastReceiver receives the BOOT_COMPLETED intent inside it's
> onReceive() function.
>
> Now using Gingerbread environment, when I try to send the
> "android.intent.action.BOOT_COMPLETED" intent (lets say from terminal
> using the 'am' command). My Service (which is currently in NOT running
> state) is able to receive this intent in it's onReceive() and
> processes the further executions.
>
> But when I am using the ICS environment, when I try to send the
> "android.intent.action.BOOT_COMPLETED" intent as mentioned above, my
> Service (which is currently in NOT running state) is NOT able to
> receive this intent in it's onReceive().
> For this case, when I try somehow to start my Service by calling it's
> onCreate() explicitly by using some other Application and then if I
> again send the BOOT_COMPLETED intent as above, then it is able to
> receive this intent in it's onReceive() (i.e. only when my Service is
> in running state).
>
> I would really appreciate if someone can confirm that in case of using
> ICS environment , do we need to start a service first before actually
> making it able to receive an intent in it's onReceive() function ?
> Also, the reasoning for this would be highly appreciable, if there is
> some  :-)  ?
>
> Thanks in advance !!

-- 
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