I am trying to find the right approach in setting the placeholder image/resource (VectorDrawable resource in my case) for an ImageView that gets set, with the target image bitmap when it is available.
There are two approaches I saw in guides. I can either set a background using the background property on XML or programmatically using setBackground(). Then, I would set the target image using setImageDrawable().
The second approach is to use setImageDrawable() for the placeholder and later use setImageDrawable() again for the target image.
Both approaches work but I have noticed some UI lag when using the first approach. I am not sure if it is caused by the approach or not.
So, I want to know. What is the correct approach in using placeholders and why?
Thank you.