Hi,
What's the correct way of dealing with a Canvas? I've got an activity that creates a canvas from a panel, initializes two bitmaps, which are drawn onto the canvas. I get an Out of Memory when opening/closing the activity a certain number of times. I've tried the recyle trick that I found in the forums, but I then get a 'cannot draw recycled bitmaps' error on closing the activity. I'm guessing the recycle trick is similar to the Dispose method in .Net but it's just giving me grief.
Cheers,
Richard
ps I have orientation sensor code calling a paint method on this activity if it's not paused, to update the canvas. I thought perhaps this was causing the 'cannot draw recycled ...' error, but even with setting a flag to True before I recycle, and checking this flag and exiting the paint method if the flag is set, I still got the error.
What's the correct way of dealing with a Canvas? I've got an activity that creates a canvas from a panel, initializes two bitmaps, which are drawn onto the canvas. I get an Out of Memory when opening/closing the activity a certain number of times. I've tried the recyle trick that I found in the forums, but I then get a 'cannot draw recycled bitmaps' error on closing the activity. I'm guessing the recycle trick is similar to the Dispose method in .Net but it's just giving me grief.
Cheers,
Richard
ps I have orientation sensor code calling a paint method on this activity if it's not paused, to update the canvas. I thought perhaps this was causing the 'cannot draw recycled ...' error, but even with setting a flag to True before I recycle, and checking this flag and exiting the paint method if the flag is set, I still got the error.