Like title said it needs to update image with new picture in Android Compose, using Coil.
AsyncImage(
model = URL,
contentDescription = "",
modifier = Modifier.clickable(onClick = {
//Maybe here to add code?
})
)
What I need is to load new picture from link into existing AsyncImage.
Create a mutable state that you update with new url:
var model by remember { mutableStateOf(URL) }
AsyncImage(
model = model,
contentDescription = "",
modifier = Modifier.clickable(onClick = {
model = newUrl
})
)