BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-22-2008, 05:15 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2008
Model: 8310
PIN: N/A
Carrier: Informatico
Posts: 56
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default work with screens

Please Login to Remove!

Hi

I have worke with midlet but now I am working with UiApplication and I don't know how can i work with screens, this is the code of my main screen

public class Rutas extends UiApplication {
public static void main(String[] args) {
Rutas theApp = new Rutas();
theApp.enterEventDispatcher();
}
public Rutas() {
pushScreen(new ConfigurarPantalla());
}
}

final class ConfigurarPantalla extends MainScreen {
private PasswordEditField _password;
private HttpConnection c;
.....
...

How can I add more screen and show it?

Thanks, Oscar
Offline  
Old 04-22-2008, 06:25 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

just to tidy things up i would suggest that you define your screens in their own files.

you can create as many screens as you like and push or pop them.

while looking at your code i saw httpconnection, i would advise you not to use it in ui components as network operations are blocking. put them into an own thread and use an own class for communication.

hth,
simon
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-22-2008, 06:39 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2008
Model: 8310
PIN: N/A
Carrier: Informatico
Posts: 56
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

and how can come back to the last window? how can I move between all windows that i have created?

Thanks, Oscar
Offline  
Old 04-22-2008, 07:55 AM   #4 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

the screens are on a stack and can be put on it via push, removed via pop.
you should think about your workflow beforehand and arrange the screen-handling accordingly.

to do this there are different ways. you can let the screens do "the work" like push another screen (quick&dirty).
or you can use a callback to have your controller push a screen (MVC) .

to move back to the last screen you only have to dismiss (pop) the current one, as the last screen is just one layer below on the stack.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 04-22-2008, 08:45 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2008
Model: 8310
PIN: N/A
Carrier: Informatico
Posts: 56
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you again!
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.