When I got a list with items (articles), which data is loaded from a web-API as JSON, using Retrofit. I populate a LazyColumn with some of the loaded data. From a single article one can navigate into a details-view, which contains all data concerning the article.
What possibility for providing the data to the details-view is preferable?
Both approaches have their own advantages and considerations. The preferable approach depends on factors such as the size and frequency of data updates, the type of data/information, and the requirements. If the data is large, passing it as a bundle
between views can lead to increased memory usage, which is not recommended.
The best way to handle this situation is to pass some initial information to the details UI. When an API call is made for the details, the user will see the initial information on the view. For example, in your case, on the article details page, you can initially show the title, date, time, and header image as basic information.
However, if the data is large or dynamic, fetching the complete data using the ID can ensure data accuracy and prevent memory issues. By retrieving the complete data when needed, you can provide the user with the most up-to-date information while minimizing memory usage.