Best way to change ImageView image? RRS feed

  • Question

  • User16595 posted

    Hi everyone!

    I have an activity with 6 ImageViews ontop of each other that almost fill out the devices screen. When a button is touched, I need to replace some of the images with others. This action is repeatable, so every time the user touches the button (so changing the image) the available memory is going down till my app gets very slow. This is what I did to counter that:

    using(AndroidGraphics.Bitmap bitmap = await loadBitmap("PathToImageSavedOnDevice"))
        using(BitmapDrawable bitmap2 = (BitmapDrawable)imageView1.Drawable)
            if(bitmap2 != null)

    loadBitmap just does return await AndroidGraphics.BitmapFactory.DecodeFileAsync(filePath);

    I'm loading and changing all my images like above. Is there something I could change or doing entirely wrong here?

    Saturday, November 7, 2015 1:56 AM

All replies