BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-13-2007, 06:05 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default is the screen popped correctly?

Please Login to Remove!

hi,
i've got a problem with my screens.
i push a new screen with the help of my menu, looks like this:
Code:
_AnforderungItem = new MenuItem("New Screen", 100000, 10) {
            public void run(){
                    ActionsScreen mscreen;
                    mscreen = new ActionsScreen();
                    mscreen.setTitle("my New Screen =)");
                    pushScreen(mscreen);
            }
        };
Now i've got my new screen with a horizontal Manager,some other stuff, and there is a menu with the item close, looks like:
Code:
public boolean onClose () {
         int antwort = Dialog.ask(Dialog.D_YES_NO,"Beenden?");
             if (antwort == Dialog.YES) {
             UiApplication.getUiApplication().popScreen(this);
    }
        return true;
     }
Ok, i click the menu item and now I'm at the "mainscreen" of my Application. Now I want to push the other screen again, so I select the menu and the first posted source-code should push the new screen.

It does push the new screen, i get an errormessage:
"Field added to a manager while it is already parented".

So i thought that by poping the screen the var's, fields etc are popped from the stack, so that i get a completely new screen with no relation to the old one...

How can i dispose the screen with all it's components, so that i can push the screen more than one time?

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after

Last edited by hibbert : 12-13-2007 at 06:13 AM.
Offline  
Old 12-13-2007, 08:17 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: Berlin
Model: 8100
PIN: N/A
Carrier: O2
Posts: 127
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do it in a similar way and it does work. Try to do the following as a test:

Code:
_AnforderungItem = new MenuItem("New Screen", 100000, 10) {
            public void run(){
                    pushScreen(new ActionsScreen());
            }
        };
without defining it before and setting the title.

BR AxelE
Offline  
Old 12-13-2007, 08:40 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2005
Location: Berlin
Model: 9500
OS: v4.7.0.78
PIN: 20CAFA18
Carrier: O2
Posts: 39
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem lies not inside the code you've posted. As the error message says there is a field parented to a manager already. I would say your stuff inside your screen is reused while your are constructing a new screen every time you call this menu. So it would be a solution to release all the things from your screen you want to add ones again if you close it.
Offline  
Old 12-13-2007, 08:59 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
thanks for your reply, but it's still the same problem :(

hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline  
Closed Thread


Thread Tools

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

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





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.