Domanda

Why do we use restartLoader(), if loader already implicitly listens to any updations in the database? Do we use it to reuse the same loader to send a different query?

È stato utile?

Soluzione

Because sometimes you might want to change your where condition in your query. You can call restartLoader and pass your where condition in the Bundle argument. restartLoader will call initLoader again and create a new cursorloader with the new where condition. If you don't call restartLoader, you can not change the where condition in your query.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top