I want a handle to my sqlite database to be available to many activities.
I read about subclassing Application, and storing things there. Then I
should be able to get them through getApplicationContext(). An article
explaining this says that I must "specify that class in the application
tag in your manifest". What would that <application> tag attribute look
like?
Also, in the docs for android.app.Application, this is said:
There is normally no need to subclass Application. In most situation, static singletons can provide the same functionality in a more
modular way. If your singleton needs a global context (for example to register broadcast receivers), the function to retrieve it can
be given a Context which internally uses Context.getApplicationContext() when first constructing the singleton.
I don't really understand this, although I know what a singleton is.
Also, if android reclaims my apps memory after a long period of disuse,
does the app actually have to start up again from scratch when it comes back?
Can there be no static state through that process?
Thanks,
Tobiah
--
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