In my app, the user selects an image from the gallery by clicking a button. After that, he can select another image from the gallery by pressing the button again, and the new image will replace the previous one. But the point is that the selected image is first saved with the same name as the previous image and then displayed. The problem is that Asyncimage()
does not show the new item because the new and previous items have the same name (and path). How can I force Asyncimage()
to look at the same path again?
I tried CachePolicy.DISABLED
and it didn't work:
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(uiState.value.imagePath)
.crossfade(true)
.memoryCachePolicy(CachePolicy.DISABLED)
.build(),
...
)
Thanks