'How to mark end of dataset in android paging 3 library? [closed]

I am trying to use Android new Paging 3 Library in my app. I am fetching data from a backend API using Retrofit, which returns a list of objects. I need to know how to inform Pager to stop loading more data when the API returns an empty list.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source