Hey guys,

I'm beginning to bring my application out of the dark ages (API 7) up to 
the more recent stuff and I'd like to migrate from my current Singleton 
data provider to something like the Loader paradigm. I had a couple of 
question. Currently, when the Application starts, I pull all of my objects 
out of the database and hold them in a singleton User object on the 
Application. The Activities then pass around ID references which query the 
singleton for values. This breaks down rather dramatically when the 
application is terminated and doesn't really jive well with "the Android 
way." I've started to do some testing with loaders and have based my test 
implementation off the follow tutorial:

http://www.androiddesignpatterns.com/2012/08/implementing-loaders.html

Couple Questions:
1. Are loaders special? Are they handled differently from a LifeCycle 
perspective or is it simply a more streamlined way of doing loading in an 
AsyncTask then returning it to the Activity?

2. There always seems to be a nasty flash of an empty list on my 
Activities. Should the onResume check for a load and load immediately? 
(deliverResults?)

3. Do the loaders save state in an onSaveInstanceState sort of way?

4. I'm a little foggy on the ContentObserver. My data is backed up by the 
SQLlite DB... is a ContentObserver "better", or should I just manually 
invoke BroadcastReceivers when my application pulls down new data?

5. How should I handle loading animations in the Activity? Traditional way 
of start/stopping the "Loading" animation? My question is around when... 
show ProgressBar in onResume and hide it on onLoadFinished?

Thanks for any pointers!

E

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

Reply via email to