Is this a bug in Kodular or am I doing something wrong?

I am making a simple drawing app using the canvas. I am storing all the lines, the color of the lines and the thickness of the lines in three lists that I then use to recreate the drawing using a for-loop. This works pretty great because it makes it possible to edit drawings.
Now the problem/bug is this:

I use a list view to store all the user’s drawings and then when an item in the list is selected I use tiny_db to get the three lists I was talking about earlier and I then loop over the lists(s) and recreate the drawing on a canvas. Now I am experiencing a really strange bug. The first time I click on an item (after an app restart) in the list view it shows the canvas but no lines are shown, now the strange part if I go back (I have a back button in the app) and click on the same item in the list the canvas is shown and all of the lines are there (in the correct color and so on)!! Why is this happening! If it would never load it would obviously be a block-bug but it only happens the first time a drawing is opened. After the first drawing is opened and doesn’t load everything loads perfectly but it is always the first drawing that doesn’t load.

This seems to be more of a bug with a component and less of a bug caused by my blocks.

Technical information

I have tested this on both the companion and as an installed app. I use android 8.0 on an Onplus 3t.

It might be a bit problematic for me to share my blocks since this is quite a big application other features besides the drawing functionality.

Cheers, Edvard

First things first, is to isolate and test this feature. I would start a new small app, just with the function you are talking about, and try to recreate the issue.

Often with large apps, you can have conflicts in variables etc etc.

It will make it easier for us to help as well and you to share blocks.

2 Likes

I created a project and tested it in the companion. I am loading the drawing on the Screen1.Initialize event but I can also load the drawing with a button press. This works and the drawing is loaded as expected. But the problem is not that the drawing doesn’t load it does but only after the first load or “attempt”.

Anyway here is a picture of the block in the test app:

Add a timer it might help.

/Boban

1 Like