Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top