Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: Virtual Keyboard causes OutOfMemoryError

[ Edited ]
You cant set an int to null, but if you know all your values ahead of time you can just set eventbutton to -1 then check to see if it is greater than zero.
Message Edited by CMY on 10-01-2009 10:14 AM
Developer
Posts: 266
Registered: ‎04-24-2009
My Device: Not Specified

Re: Virtual Keyboard causes OutOfMemoryError

I'm afraid you lost me now. If we don't set int to null, then we are not deleting and recreating like the screen variable.

 

I read up on memory management a few days ago and I seem to remember that variables like int and boolean were excluded from the memory management issues where a string or simular needs to be set to null.  Plus the int variable was right out of RIMs examples and I only call field changed a couple of times before the crash, so I think my outofmemory error has to do with something else.

 

Thanks though.  Deletting and recreating the screen was an important issue that I missed.

 

Any other ideas for where the problem might lie???

Highlighted
Developer
Posts: 266
Registered: ‎04-24-2009
My Device: Not Specified

Re: Virtual Keyboard causes OutOfMemoryError/Custom Button Fields

REXDOUG and Peter Strange figured out that the sample custom buttom code from RIM had a problem with the bitmap variable decleration.

 

the sample code is as follows

 


    private Bitmap _onPicture = Bitmap.getBitmapResource("img/pink_scribble.bmp");

 

If I change to static, loads times go from about three minutes to almost instant and the outofmemory errors go away.

 

Problem appears to be solved.