Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>Loader</code> documentation is flawed.</p> <p>100% of <code>Loader</code> implementations built into Android itself "monitor the source of their data and deliver new results when the contents change". Since there is only one <code>Loader</code> implementation built into Android itself as of now, their documentation is accurate as far as that goes.</p> <p>However, quoting a book update of mine that should be released in an hour or two:</p> <blockquote> <p>There is nothing in the framework that requires this behavior. Moreover, there are some cases where is clearly a bad idea to do this – imagine a Loader loading data off of the Internet, needing to constantly poll some server to look for changes.</p> </blockquote> <p>I do plan on augmenting <code>SQLiteCursorLoader</code> to be at least a bit more aware of database changes, if you route all database modifications through it. That too will have limitations, because you don't share <code>Loader</code> objects between activities (let alone have access to them from services).</p> <p>The only reason <code>CursorLoader</code> works as it does is because it uses a <code>ContentProvider</code> -- a singleton that can therefore be aware of all operations.</p> <p>At the moment, whatever portion of your code is responsible for inserts, updates, and deletes will either need to tap the <code>SQLiteCursorLoader</code> on the shoulder and have it update, or notify the activity of the change (e.g., broadcast from a <code>Service</code>) so the activity can tap the <code>SQLiteCursorLoader</code> on the shoulder.</p>
    singulars
    1. This table or related slice is empty.
    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.
    3. 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