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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
Developer
CMY
Posts: 1,115
Registered: ‎02-10-2009
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
Please use plain text.
Developer
JamesColeman
Posts: 266
Registered: ‎04-24-2009

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???

Please use plain text.
Developer
JamesColeman
Posts: 266
Registered: ‎04-24-2009

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.

Please use plain text.