Go Back   BlackBerry Forums at CrackBerry.com > BlackBerry Professionals > Developer's Forum

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-14-2009, 01:53 PM
jeff.parent's Avatar
CrackBerry Abuser
Device Model: 8310 (Curve)
Carrier: AT&T/Cingular
PIN: 209b3a24
 
Join Date: Feb 2009
Location: Ames, IA
Posts: 166
Default How to close a screen

So I have an app I'm writing (long time HDL/C/C++ programmer, not so much with the Java) and I have my main screen up (DeviceListScreen). I created a menu item to open a new screen (AddNewDeviceScreen) where the user enters data which will be saved into a list once the user closes this new window. To get this info from AddNewDeviceScreen into my main class's list I have overwritten AddNewDeviceScreen.onClose() to gather the info, put it in the list and then close and go back to DeviceListScreen. This is the issue.

I know this isnt exactly how the code looks but this is the idea.

MenuItem m_AddDeviceItem = new MenuItem(...)
{
void run()
{
DeviceListScreen dls = new DeviceListScreen();
UiApplication.getUiApplication().pushScreen(dls);
}
}

....

public boolean DeviceListScreen.onClose()
{
// Put data in list.

return true;
}

Whil I'm stepping through the code, the onClose() gets called and everything happens nicely, except the screen doesnt go away. Since I've overwritten the onClose method is there something else I need to do like a popScreen?
__________________
BlackBerry Addict in Iowa
PIN: 209B3A24
www.twitter.com/jeffparent
Reply With Quote
  #2  
Old 04-14-2009, 07:06 PM
CrackBerry Abuser
Device Model: 9000 (Bold)
Carrier: Vodafone
 
Join Date: Oct 2008
Posts: 489
Default

Yes, you need to pop the screen. Read the API javadocs or find some sample code.
Reply With Quote
  #3  
Old 04-14-2009, 07:59 PM
jeff.parent's Avatar
CrackBerry Abuser
Device Model: 8310 (Curve)
Carrier: AT&T/Cingular
PIN: 209b3a24
 
Join Date: Feb 2009
Location: Ames, IA
Posts: 166
Default

I eventually figured out that I was not calling close() on the screen. That solved my problem.

Posted from my CrackBerry at wapforums.crackberry.com
__________________
BlackBerry Addict in Iowa
PIN: 209B3A24
www.twitter.com/jeffparent
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



 
 Site Support | Accessory Order Support | App Store Support | Advertise | Newsletter | About Us

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

The names RIM and BlackBerry are registered Trademarks of Research in Motion Limited.
CrackBerry.com is in No Way Affiliated with Research in Motion Limited.
Copyright ©2007-2009 Smartphone Experts. Terms and Conditions. Privacy Policy. All rights reserved.