09-14-2009 12:03 AM
I have NO IDEA what is going on. Everything was working great, I changed some custom bitmap buttons, now any screen that has an EditField crashes when the virtual keyboard comes up or shortly after when I start typing text in the edit field, or sometimes when I hide the keyboard.
Uncaught exception thrown - OutOfMemoryError
Everything else in the program works fine.
I can not understand the Calling Method information enough to locate the problem but bitmap is on the first line, so I would assume it has something to do with my buttons I changed. But what would they have to do with an editField and the virtualkeyboard?
Any thoughts would be appreciated.
Solved! Go to Solution.
09-14-2009 12:09 AM
I can start the program show the keyboard, hide the keyboard, and then any button I push also causes a Uncaught exception thrown - OutOfMemoryError. If I never show the keyboard, everything works.
09-15-2009 07:14 PM
I'm still working on this one.
If I view the memory statistics everything looks fine until I start a keyboard.
To keep it simple, I started the program, checked the memory, used the menu key to display the keyboard and hide the keyboard. The RAM lost -1283588 and FLASH lost -1547524 after displaying and hiding the keyboard. I hit another button and got theOutOfMemoryError.
I'm still not sure what to do. I didn't write the keyboard code.
If someone could point me in the right diection, I would appreciate it.
09-15-2009 08:27 PM
Sounds to me like displaying the keyboard is causing a sublayout, and this is getting into some type of endless loop, consuming system resources. I can pretty-much guarentee that the keyboard popup didn't eat 1.2MB of RAM and 1.5MB of flash.
Look very closely at layout() or sublayout() overrides.
09-15-2009 10:43 PM
I made it quite a few months without needing any help, but I seem have had some bad Karma lately. I have several issues I
am working on right now.
I think this one is solved though. Your suggestion of "Look very closely at layout() or sublayout() overrides." sent me in the right direction. I haven't quite got it wokring yet, but at least I kow where the problem is.
I have learned more too.
09-18-2009 01:29 PM
09-18-2009 05:11 PM
Let's try again
I have been working on this for quite a while. And while I have learned a lot, but I still have the OutOfMemoryError with the Virtual Keyboard. It sure seems that REXDOUG is correct in that it is in the layout() or sublayout() overrides when the keyboard moves the screen. However, I'm not seeing it.
I commented out most of my code and I'm wondering if the problem is in my approach and I have done something "illegal". I have a complex popup screen that seemed like a nightmare to accomplish with vertical and horizontal managers, so I set it up as a Manager and used sublayout to layout my button fields. I simplified the layout code in the example just to keep it breif.
I have tried the following with and without the getPreferredWidth and getPreferredHeight and super.sublayout.. the Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR are also something I was playing with.
class MenuScreenManager extends Manager
super(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR);
protected void sublayout(int width, int height)
int XPosition = 0;
int YPosition = 0;
int iNumFields = getFieldCount();
for(int i=0; i<iNumFields; i++)
Field field = this.getField(i);
XPosition = XPosition + 48;
setExtent (480, 48);
//setPosition (0, 0);
setPosition (0, 312);
/* public int getPreferredWidth()
public int getPreferredHeight()
I also experimented with adding a sublayout from the screen itself.
/* protected void sublayout(int width, int height)
//setExtent (480, 48);
I also use custom button fields so the problem might be there, but I wouldn't think the problem would be with the button. There isn't much to that code.
Any thoughts would be appreciated.
09-18-2009 09:09 PM - edited 09-18-2009 09:09 PM