Per the Android Documentation it states (http://developer.android.com/reference/android/app/Application.html) :
There is normally no need to subclass Application.
My question is that. My app needs to prepare some data (e.g. load some states data from shared preference) at app startup time before it can do anything else. I usually put the data preparation logic in a class that subclasses Application.
If subclassing application is not encouraged, where should I put the app-startup-time data preparation logic? What are the best practices?
Thanks.
Its not that it is discouraged, its just that as they said, it is "normally" not needed.
In your case, you use it correctly, I have done the same in many of my own apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With