开发者

Error when use UIAplication.getUIApllication.pushScreen(screen) on Blackberry?

开发者 https://www.devze.com 2023-04-10 19:24 出处:网络
I have a \"Back\" button that I created. Action for it is ----- UIAplication.getUIApllication.pushScreen(screen1)

I have a "Back" button that I created. Action for it is ----- UIAplication.getUIApllication.pushScreen(screen1) I did so because I want to refresh screen 1 when I cick "Back ".

But there have an error that " OutOfMemoryError" when I click "Back" few times. If I replace with - UIAplication.getUIApllication.popScreen(this) , there have no error . But I rea开发者_JAVA技巧lly want to refresh screen1. Why I gotthis error ? How to solve it ? ( I use Persistenobject to save data for my app ). Please help me . Thanks a lot.


Pushing the same screen again adds additional screen to stack and takes additional memory. And it is logical that you get outofmemory error.

If you want to refresh field's/manager's contents use invalidate() method of a particular field or manager.


You can try popping the old screen1 and then pushing it again:

UIAplication.getUIApllication.popScreen(getScreenBelow());
UIAplication.getUIApllication.pushScreen(new screen1());
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号