Well, to be honest I didn't read this on your book, but in _the other one_ :-)
In any case, it looks like it's a commonly suggested practice.

Thanks anyway,
Federico

On Mon, Nov 8, 2010 at 1:40 AM, davemac <[email protected]> wrote:
> I saw Dianne's post on Oct 31 regarding this topic. I'm also a co-
> author of an Android book that advocated the approach of extending the
> Application class. We're currently busy updating in preparation for
> Pro Android 3, and I can assure you I've already replaced that section
> with one explaining how to create and use singletons instead. Sorry
> for the confusion in the book.
>
> - dave
> www.androidbook.com
>
> On Nov 1, 6:09 pm, Federico Paolinelli <[email protected]> wrote:
>> Ok I'll go that way. Thanks a lot.
>>
>> Federico
>>
>>
>>
>> On Tue, Nov 2, 2010 at 12:02 AM, Dianne Hackborn <[email protected]> wrote:
>> > Yes the application object is always created before any other of your
>> > components in the process.
>> > There is no need to use the application class to implement singletons (that
>> > part of the docs is totally wrong, I just put in a change to get rid of 
>> > it).
>> >  I suggest avoiding that entirely and just write a singleton without it.
>>
>> > On Mon, Nov 1, 2010 at 3:49 PM, Federico Paolinelli <[email protected]>
>> > wrote:
>>
>> >> In a book I read, the author suggests to extend the application class
>> >> in order to have a place to be used as a singleton. In this way, it is
>> >> easy to make some initialization stuff in it onCreate().
>>
>> >> Now my question: if my application has also some broadcast receivers
>> >> declared in the manifest, and the application was not started
>> >> explicitly, or it was but then the os reclaimed it resources back,
>> >> what will be happening if the broadcast receiver is triggered? Will
>> >> the onCreate of the application class be called first?
>>
>> >> Thanks in advance,
>>
>> >> Federico
>>
>> >> --
>> >> 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
>>
>> > --
>> > 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
>>
>> --
>> --------
>> Federico
>
> --
> 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



-- 
--------
Federico

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