Hello, Sorex and eps,
My whole intent is to put a border around the panels similar to panels in Visual Basic in MS. My wish would be that it would be a property in B4A. I have not tried it in B4J (no time), but I would venture to guess that it is a property for the panel container.
The purpose of the border around the panel was only to delineate different sections of the activity since it contains many sections, and the app contains many activities. Each panel contains other views labels, Imageview, buttons, listviews, etc.
I looped 30 times to see when I could recreate the error. In my app, I only draw the rectangle once when the activity is started. When I exit the activity, I issue Activity.Finish, but apparently that does not free the memory or leaves a little garbage behind which after staring the activity several times, creates the Out of memory situation. In my app, the number of panels range from 2 to 17 depending on the activity.
I know I could use a gradientDrawable appearance combined with different shade of the color palette I selected to separate the sections, but I thought the canvas was clearer. Although at this point, I am leaning in that direction of dropping the rectangles altogether.
Canvas has to be initialized each time since the target is a different panel - in the example, Panel1, 2, and 3.
Best regards.
Sandy