On most of devices calling twice canvas.initialize(imageview) does not make any diference but I do have crashes due to oom with same code on samsung devices.
1.Question: Can the process crash with oom due to multiple initialization for canvas object ?
Do I have to use several canvas objects for each view that I want to draw into ?
What hapens to canvas object in the next initialisation if I do not call view.invalidate on first usage ?
Exemple of usage:
I generaly use an imageview sized activity.width and activity.height I think device can run out of memory due to imgeview size on large display.
2.Question: Initialising a canvas on a large imageview screen sized can cause oom ?
3.
Canvas documentation sais:
The view background will be drawn on the canvas during initialisation.
Note that you should not change view background after calling this method.
3.Question: Can somebody explaing how the change of the background view can affect the canvas, can this be related to OOM ?
Thank you for your suport.
1.Question: Can the process crash with oom due to multiple initialization for canvas object ?
Do I have to use several canvas objects for each view that I want to draw into ?
What hapens to canvas object in the next initialisation if I do not call view.invalidate on first usage ?
Exemple of usage:
B4X:
'on large apps I may have missed the invalidate statement after drawing so I do not understand how the drawing consumes memory and how to optimise it.
canvas.initialize(imageview1)
canvas.DrawLine(x0,y0,X,Y,maincolor,pensize)
imageview1.invalidate
canvas.initialize(imageview2)
canvas.DrawLine(x0,y0,X,Y,maincolor,pensize)
imageview2.invalidate
I generaly use an imageview sized activity.width and activity.height I think device can run out of memory due to imgeview size on large display.
2.Question: Initialising a canvas on a large imageview screen sized can cause oom ?
3.
Canvas documentation sais:
The view background will be drawn on the canvas during initialisation.
Note that you should not change view background after calling this method.
3.Question: Can somebody explaing how the change of the background view can affect the canvas, can this be related to OOM ?
Thank you for your suport.