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