Android Question Changing targetSdkVersion ImageView not visible

AHilberink

Active Member
Licensed User
Longtime User
Hi,

Using targetSdkVersion=13 my ImageView is correct visible.
Changing it to targetSdkVersion=28, my image is not visible. Changing back to 13 it is visible again.

I used PNG and JPG to test, but both have the same problem.

Can someone tell me what happen and what to do to solve it?

Best regards,
André
 

DonManfred

Expert
Licensed User
Longtime User
You should not use 28 for now. The suggested targetsdk for now is 26.
 
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
Please upload a small program that demonstrates it.

Building a small example, it seems to have something to do with the bitmap. Replacing it with an example image it works fine on all SDKtargets. Because it was a converted PDF, I tried different software to convert.

It works fine now. Strange, because opening with different viewers, the JPG and PNG converted by the first programm seems to be good also.

Thanks for helping.

Best regards,
André
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Upvote 0

AHilberink

Active Member
Licensed User
Longtime User
Is it a large image? I have found that setting targetSdkVersion to a value higher than 13 severely limits the size of Bitmap that can be displayed. Some of my devices throw an error about a Canvas limitation with a too large image but most just display a blank image. My ScaledImageView https://www.b4x.com/android/forum/threads/scaleimageview-pan-and-zoom-large-images.102190/ overcomes this limitation if the image is available as a file.

Hi Agraham,

Thanks for this. I think for the JPG it could be too large and the PNG had something to do with transparant. I now have a good PNG and it works fine.

Best regards,
André
 
Upvote 0
Top