Greetings, all, and thank you in advance for answering my question.
I have read a number of postings on this subject, but none of them seem to hit the mark. My apologies if this post is redundant.
I am getting an Out of Memory error in an Asus Transformer 700 V4.2.1 - 1GB RAM, 32 GB storage. I do not get the error in any of my other tablets ranging from V4.0 to 4.4.
As pointed out in other posts on this subject, the error comes from Canvas or misuse of it.
Log
The sub in the code module:
I use the Canvas rectangle as a separator for the different panels in my activities.
I use Activity.Finish upon exiting each activity.
What can I do?
Any and all help is welcomed.
Sandy
I have read a number of postings on this subject, but none of them seem to hit the mark. My apologies if this post is redundant.
I am getting an Out of Memory error in an Asus Transformer 700 V4.2.1 - 1GB RAM, 32 GB storage. I do not get the error in any of my other tablets ranging from V4.0 to 4.4.
As pointed out in other posts on this subject, the error comes from Canvas or misuse of it.
Log
B4X:
java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:689)
at android.graphics.Bitmap.createBitmap(Bitmap.java:666)
at android.graphics.Bitmap.createBitmap(Bitmap.java:633)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper.Initialize(CanvasWrapper.java:76)
at swi.myapp.CodeModule._rect_draw(td.java:735)
The sub in the code module:
B4X:
Sub rect_draw (p1 As Panel,n1 As Int,colorc As Int)
Dim canvas2 As Canvas
Dim rect2 As Rect
canvas2.Initialize(p1)
rect2.Initialize(0dip,0dip, p1.width-n1+1, p1.height-n1+1)
canvas2.DrawRect(rect2, colorc, False, n1*1dip)
p1.Invalidate 'force to redraw
End Sub
I use the Canvas rectangle as a separator for the different panels in my activities.
I use Activity.Finish upon exiting each activity.
What can I do?
Any and all help is welcomed.
Sandy