Re: [android-developers] Understanding the lifecycle of ViewPager

2011-11-28 Thread Chris Stewart
It seems like the Loader is now a replacement for AsyncTask, but does it also replace the use of a Runnable/Thread scenario? The AsyncTask is more difficult to set up, so I understand why a Loader makes sense there (

Re: [android-developers] Understanding the lifecycle of ViewPager

2011-11-28 Thread Dianne Hackborn
Loader is not a replacement for AsyncTask. In fact, Loader itself does nothing, it is just the hook into interacting with the lifecycle of LoaderManager/Activity/Fragment. AsyncTaskLoader is a Loader that uses an AsyncTask to do its loading on a separate thread. This also is not a replacement

Re: [android-developers] Understanding the lifecycle of ViewPager

2011-11-28 Thread Chris Stewart
I see, and that makes more sense. Thanks for the explanation. While using an AsyncTaskLoader wasn't completely necessary for what I'm doing, I have it all working and it wasn't complicated to get going. So I'll call that a win-win. I did manage to solve the original intent of this question

Re: [android-developers] Understanding the lifecycle of ViewPager

2011-11-09 Thread Mark Murphy
On Tue, Nov 8, 2011 at 10:51 PM, Chris Stewart cstewart...@gmail.com wrote: Thanks for the reply Dianne.  I'm not completely sure what you mean by custom loader, are you referring to what was introduced in 3.2?  If so, is it available in the support library for pre-3.2? The Loader framework is

[android-developers] Understanding the lifecycle of ViewPager

2011-11-08 Thread Chris Stewart
I'm working on implementing ViewPager and I want to let the host activity load the background data (from the Internet) instead of each fragment doing an independent I/O request. The reason why is because the same data is being loaded into two fragments, with the only difference being a category.

Re: [android-developers] Understanding the lifecycle of ViewPager

2011-11-08 Thread Dianne Hackborn
Off-hand, I think it would be easier to implement a custom loader that knows how to load the data once and share it across all requests. On Tue, Nov 8, 2011 at 1:06 PM, Chris Stewart cstewart...@gmail.com wrote: I'm working on implementing ViewPager and I want to let the host activity load the

Re: [android-developers] Understanding the lifecycle of ViewPager

2011-11-08 Thread Chris Stewart
Thanks for the reply Dianne. I'm not completely sure what you mean by custom loader, are you referring to what was introduced in 3.2? If so, is it available in the support library for pre-3.2? I'm looking for similar functionality found, or at least perceived to be, in the Google+ app. You can