Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the data is already loaded (as it seems in your 'mAddresses' variable which is in the Loader) you need to call forceLoad() to get it to load again:</p> <p><a href="http://developer.android.com/reference/android/content/Loader.html#forceLoad%28%29" rel="noreferrer">http://developer.android.com/reference/android/content/Loader.html#forceLoad%28%29</a></p> <p><br/> <br/></p> <p><strong>Edit:</strong> ...after some investigation... To answer your original question, unhelpfully: 'because it doesn't'!</p> <p>From the source for LoaderManager:</p> <pre><code> // Notify of the new data so the app can switch out the old data before // we try to destroy it. if (mData != data || !mHaveData) { mData = data; mHaveData = true; if (mStarted) { callOnLoadFinished(loader, data); } } </code></pre> <p><a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.3_r2.1/android/app/LoaderManager.java#LoaderManagerImpl.LoaderInfo.onLoadComplete%28android.content.Loader%2Cjava.lang.Object%29" rel="noreferrer">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.3_r2.1/android/app/LoaderManager.java#LoaderManagerImpl.LoaderInfo.onLoadComplete%28android.content.Loader%2Cjava.lang.Object%29</a></p> <p>RE your problem, I'm assuming that you're continually adding to the List in loadInBackground() rather than clearing and starting again. The cleanest way is to build a new ArrayList each time by passing in the existing List as an argument to the ArrayList() constructor, it will copy the contents.<br> Or you could override deliverResult(), it's called from the main thread so modifying mAdapter is OK.<br> Or forget the Loader and just use a much simpler AsyncTask... although that depends on where your data actually comes from.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload