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.

inside custom component

Java Development

Reply
Developer
Posts: 17
Registered: ‎04-22-2009
My Device: Not Specified
Accepted Solution

Screen Navigation Problem

Hi,

I am new to BB Java Application development and facing problem related to screen navigation.

 

I have two Screens in my application. One is Dashboard having a Icon , and on pressing this Icon user should be able to navigate to the other screen. I have created both the screens separately , now when I try to integrate the same i.e. when I create instance of one screen in other screen I am getting exception as : java.lang.RuntimeException: application already running in this process

 

Both the screens are extending from UiApplication.

 

So could anyone please  help me to sort this thing out ?

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Screen Navigation Problem

You do not extend UiApplication for a screen. You extend Screen (or one of its subclasses, like MainScreen).

 

Your Application class should extend UiApplication.

 

Please see the numerous examples of this in the sample programs that ship with the JDE.

 

 

Developer
Posts: 17
Registered: ‎04-22-2009
My Device: Not Specified

Re: Screen Navigation Problem

Thanx RexDoug,

 

So you mean the first screen which comes after clicking the Application Icon should only be extended from UiApplication ?

Developer
Posts: 17
Registered: ‎04-22-2009
My Device: Not Specified

Re: Screen Navigation Problem

Thanx RexDoug,

 

So you mean the first screen which comes after clicking the Application Icon should only be extended from UiApplication ?

Developer
Posts: 17
Registered: ‎04-22-2009
My Device: Not Specified

Re: Screen Navigation Problem

Thanx it done :smileyhappy: ...

 

But I have 1 more problem I am not able to go back to my original screen when I press back Button on BB.

Do I need to Push my dashboard screen on key listener for this ?

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Screen Navigation Problem

If you are extending MainScreen, the "back" button is already wired up to close the screen.

 

If you push screen #2 on top of screen #1, then close screen #2, screen #1 now comes to the top of the screen stack and is displayed.

 

If you are extending FullScreen you will have to wire up the keys yourself. I recommend overriding keyChar in the screen class.

 

 

 

 

Developer
Posts: 17
Registered: ‎04-22-2009
My Device: Not Specified

Re: Screen Navigation Problem

Thanx a lot Rex :smileyhappy: .. its done :smileyhappy: