Android Question Load .png file in ImageView

Douwe Siegersma

Member
Licensed User
Hello,

In my (first) android app I have quite a few ImageViews. They all load .jpg files.
I found better looking .png files and replaced the .jpg with the .png files.
Don't excactly what went wrong but my complete layout was gone :(
Just started over but as soon as I create an ImageView with a .png image the app crushes on loading the layout. Object should first be initialized? Spent a long time on this problem and found the solution in replacing the .png files with .gif files.
Is there a known issue with loading .png files in ImageViews?

Douwe
 

Douwe Siegersma

Member
Licensed User
I did that but quickly clicked away the avalanche of lines..:D
It had something to do with JAVA. I will try it again and let you know the results.

Douwe
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
It is easier for us to help if you upload a small example app source which shows the issue...

From the IDE: File-Export as ZIP

Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /data/user/0/b4a.example/files/virtual_assets/ledaan.png (No such file or directory)
at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:99)
at anywheresoftware.b4a.objects.ImageViewWrapper.build(ImageViewWrapper.java:120)
... 22 more
Caused by: java.io.FileNotFoundException: /data/user/0/b4a.example/files/virtual_assets/ledaan.png (No such file or directory)
ledaan.png can not be found somehow....

Again: post your project
 
Upvote 0

Douwe Siegersma

Member
Licensed User
I see that now. But I added ledaan.png to fileassets and in the designer.
There is absolutely no difference with the gif file that I can see.
And I just load the LayOut I made with the designer so there is no code to upload.
 
Last edited:
Upvote 0
Top