Attempt to invoke virtual method Error in Images

Hi,
I made a App Which Gets Images from Airtable and Display it one by one and when it reached about 21 images this error pops up i dont know why

THE ERROR :
Attempt to invoke virtual method ‘void android.graphics.drawable.BitmapDrawable.setTargetDensity(android.util.DisplayMetrics)’ on a null object reference

Thats the error I hope Someone Knows a Solution. Thanks

This is not your first question here and you have probably seen the link below. You have to give more info for instance your blocks so someone can help you. A null object doesn’t exist so something is probably wrong with your blocks.

3 Likes

You need to set an image somewhere.

I am getting images from Airtable and setting it to a Image View but after 20 images it gets glitchy and shows this error. Can it be the problem of the image i am getting after the 20th image?

Can you show us how you do this so that we can think on optimizing this?

Sure, I’ll post the blocks here

How many images are in the Database?

80 in total