The Image doesn't appear on the application on second time

Viewed 46

I created an application that allows you to select Image from the Gallery, then stores it to Firestore and display on the Lazy Column.

The first time when I add image from the Gallery it works as exppected.

But when I reload the application, the Image appears to be empty.

Here is the code I use to display the image:

 Image(
               painter = rememberAsyncImagePainter(model = model.image) , 
                contentDescription = null,
                modifier = Modifier
                    .fillMaxWidth()
                    .height(125.dp),
                contentScale = ContentScale.Crop
            )


From Gallery I store variable as Uri then when it comes to saving the image to the database, I transform the variable to String.

Perhaps, I'm mistaken about how 'rememberAsyngImagePainter' works in anyway I would like to know if I should replace it.

I also tried adding additional permission:

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

Overall, the images loads very slow or there is somethings wrong although I don't receive any error on the logs.

But I would love to receive on assistance on how to deal with this bug.

0 Answers
Related