rss
12/26/2023, 10:29 AMkotlinx.coroutines.flow.retryWhen only retries when the button is clicked?
In Android (Kotlin lang), I am retrieving data from an API using Flow. If the API throws an exception, such as no internet connection, a timeout, or an unexpected error, I want to catch it within kotlinx.coroutines.flow.retryWhen and retry the request. However, I only want to retry when a button is clicked by the user, not automatically. What is the best way to ensure that kotlinx.coroutines.flow.retryWhen only retries when the button is clicked?
I currently don’t have any code, but I want to...