Re: [android-developers] Re: Is Application.onCreate() always called when broadcast receiver gets onReceive()?
Alex, When your BOOT_COMPLETE Broadcast receiver is called, your application subclass's onCreate() method would have been called for sure. Of course it is going to be called only once, but if you already have your data initialized and cached, there should be no reason why you could not access it. I guess, if you could throw in some code, it could help debug to find the answer. Also, check if you are doing some of the initialization work in a separate thread. If that is the case, then your broadcast receiver may get invoked before the thread completes. Ganesh. On Wed, Jan 18, 2012 at 11:32 PM, Kristopher Micinski < krismicin...@gmail.com> wrote: > True, do you want to put a log in your Application onCreate and dump > us the logs to see what's going on? I don't know the behavior in the > broadcast receiver case, but I would think that your App.onCreate > should only end up getting called once, not on every onReceive, though > I will have to look at the source on that one.. > > kris > > On Wed, Jan 18, 2012 at 11:45 AM, Streets Of Boston > wrote: > > That would be very odd. I've not seen this. Your Application's onCreate > > should have been called before anything else of your app is being called. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is Application.onCreate() always called when broadcast receiver gets onReceive()?
Ah, right... Thanks for the clarification, Mark! kris On Wed, Jan 18, 2012 at 2:23 PM, Mark Murphy wrote: > On Wed, Jan 18, 2012 at 1:26 PM, Kristopher Micinski > wrote: >> Right..., but you shouldn't spawn a new process for each onReceieve... > > It is eminently possible, perhaps even likely, that each onReceive() > will wind up in a separate process. If there are no other components > running, Android will consider the process very eligible to be > terminated once onReceive() completes. > > -- > Mark Murphy (a Commons Guy) > http://commonsware.com | http://github.com/commonsguy > http://commonsware.com/blog | http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 3.7 Available! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is Application.onCreate() always called when broadcast receiver gets onReceive()?
On Wed, Jan 18, 2012 at 1:26 PM, Kristopher Micinski wrote: > Right..., but you shouldn't spawn a new process for each onReceieve... It is eminently possible, perhaps even likely, that each onReceive() will wind up in a separate process. If there are no other components running, Android will consider the process very eligible to be terminated once onReceive() completes. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.7 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is Application.onCreate() always called when broadcast receiver gets onReceive()?
Right..., but you shouldn't spawn a new process for each onReceieve... kris On Wed, Jan 18, 2012 at 1:21 PM, Streets Of Boston wrote: > Your Application.onCreate is called only once for each process it runs in. > (if you have multiple processes for your app, the Application.onCreate is > called multiple times, but still only once per process). > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is Application.onCreate() always called when broadcast receiver gets onReceive()?
Your Application.onCreate is called only once for each process it runs in. (if you have multiple processes for your app, the Application.onCreate is called multiple times, but still only once per process). -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is Application.onCreate() always called when broadcast receiver gets onReceive()?
True, do you want to put a log in your Application onCreate and dump us the logs to see what's going on? I don't know the behavior in the broadcast receiver case, but I would think that your App.onCreate should only end up getting called once, not on every onReceive, though I will have to look at the source on that one.. kris On Wed, Jan 18, 2012 at 11:45 AM, Streets Of Boston wrote: > That would be very odd. I've not seen this. Your Application's onCreate > should have been called before anything else of your app is being called. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en