BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 12-08-2005, 01:46 PM   #1
fbrimm
Thumbs Must Hurt
 
Join Date: Aug 2005
Model: 8830
Carrier: Verizon
Posts: 144
Default Multiple screens

Please Login to Remove!

I need to have a series of screens that are called as a result of actions from a previous screen.

For example, MainScreen A displays a set fields to the user. The user uses the trackwheel to move through the fields. The user then clicks on one of the fields via the trackwheelclick and MainScreen B appears with further information and selections that can be made. MainScreen C would appear based on selections made on MainScreen B, and so on. Eventually when all the choices have been made, I want to return back to MainScreen A with the display updated based on what took place.

I thought I understood that using the InvokeLater and pushScreen(new ...) was all I needed to worry about, but the fact that the screens are linked by fields and choices made is causing me grief.

I'm also seeing some strange results. For example, from MainScreen A when I use pushScreen to display MainScreen B I first get a blank screen that I have to use the trackwheel to close before MainScreen B is displayed.

Any suggestions or guidance would be greatly appreciated.

fbrimm
Offline  
Old 12-08-2005, 06:17 PM   #2
arconsulting
Thumbs Must Hurt
 
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Default

If I understand what you are saying, this should be pretty easy. You just need to issue the appropriate push and pop screens:

MainScreenA:

...
UiApplication.getApplication().pushScreen(new MainScreenB));
...

And then:

...
UiApplication uiApp = UiApplication.getUiApplication();
UiApp.popScreen(uiApp.getActiveScreen());
...

There is no need for invokeLater() since (I'm guessing) you are in the UI thread.

The one caveat is if you want to close MainScreenB when you close MainScreenC.
__________________
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
www.arconsultinginc.com
BlackBerry consulting and development (RIM SI Partner)
Offline  
Old 12-09-2005, 03:05 PM   #3
fbrimm
Thumbs Must Hurt
 
Join Date: Aug 2005
Model: 8830
Carrier: Verizon
Posts: 144
Thumbs up

Thanks Aric.

For some reason I was trying to return back to MainScreenA to launch the next screen.

You are correct. If I let MainScreenA launch MainScreenB, and MainScreenB launch MainScreenC, all is well.

The code isn't very pretty, but its working.

Thanks again for the help.

fbrimm
Offline  
Old 01-26-2007, 04:35 PM   #4
spike_pipe
New Member
 
Join Date: Jan 2007
Model: 7190
Carrier: 123
Posts: 1
Default

Hi arconsulting!!

I have a similar problem with multiple screens. I have a Menu with some buttons, and if I press anyone, display a screen, but here is the problem. When a try diplay other screen of this last screen it doesn`t work.

I use this logistic:

UiApplication
---->MainScreen
---->MainScreen
---->MainScreen
---->MainScreen

It`s a good logistic....or I have that use only classes that extend of UiApplication?ż

Here I show you part of my application:

class Menu_Sod_Pin extends UiApplication
{


public static void main(String []arg)
{
//crea una nueva instancia de la aplicacion
//e inica la aplicacion en el evento de hilo
Menu_Sod_Pin app = new Menu_Sod_Pin();
app.enterEventDispatcher();
}
// private final Bitmap bitmap_logo = Bitmap.getBitmapResource("logo_menu.png");

private final Bitmap bitmap_in_out_jor_act = Bitmap.getBitmapResource("ic_in_out_jor_act.png");
private final Bitmap bitmap_in_out_jor = Bitmap.getBitmapResource("ic_in_out_jor.png");

private final Bitmap bitmap_sync_act = Bitmap.getBitmapResource("ic_sync_act.png");
private final Bitmap bitmap_sync = Bitmap.getBitmapResource("ic_sync.png");

private final Bitmap bitmap_ev_act = Bitmap.getBitmapResource("ic_ev_act.png");
private final Bitmap bitmap_ev = Bitmap.getBitmapResource("ic_ev.png");

private final Bitmap bitmap_capac_act = Bitmap.getBitmapResource("ic_capac_act.png");
private final Bitmap bitmap_capac = Bitmap.getBitmapResource("ic_capac.png");

private final Bitmap bitmap_comen_act = Bitmap.getBitmapResource("ic_comen_act.png");
private final Bitmap bitmap_comen = Bitmap.getBitmapResource("ic_comen.png");

private final Bitmap bitmap_proy_act = Bitmap.getBitmapResource("ic_proy_act.png");
private final Bitmap bitmap_proy = Bitmap.getBitmapResource("ic_proy.png");

private final Bitmap bitmap_fin_act = Bitmap.getBitmapResource("ic_fin_act.png");
private final Bitmap bitmap_fin= Bitmap.getBitmapResource("ic_fin.png");



public Menu_Sod_Pin ()
{

MainScreen mainScreen = new MainScreen();

// DateField dateTimeField = new DateField("", System.currentTimeMillis(), DateField.DATE_TIME);
// String date=dateTimeField.toString();
// LabelField cont_fech= new LabelField(date,Field.FIELD_LEFT);

//private final Bitmap myBitmap1 = Bitmap.getBitmapResource("logoact.png");



//LOGO
// BitmapField bitmapField = new BitmapField(bitmap_logo,BitmapField.NON_FOCUSABLE) ;

//INICIO / TERMINO DE JORNADA
BitmapField bitmapField_in_out_jor = new BitmapField(bitmap_in_out_jor,BitmapField.FOCUSABL E)
{
public void onFocus(int direction)
{
setBitmap(bitmap_in_out_jor_act);
}
public void onUnfocus()
{
super.onUnfocus();
setBitmap(bitmap_in_out_jor);
}

public boolean trackwheelClick(int status, int time)
{
pushScreen(new InOutJor_class());
return true;
}
};


//SYNCRONIZATION
BitmapField bitmapField_sync = new BitmapField(bitmap_sync,BitmapField.FOCUSABLE)
{
public void onFocus(int direction)
{
setBitmap(bitmap_sync_act);
}
public void onUnfocus()
{
super.onUnfocus();
setBitmap(bitmap_sync);
}

public boolean trackwheelClick(int status, int time)
{
// pushScreen(new Sync_class());
return true;
}
};


//EVALUACIÓN
BitmapField bitmapField_ev = new BitmapField(bitmap_ev,BitmapField.FOCUSABLE)
{
public void onFocus(int direction)
{
setBitmap(bitmap_ev_act);
}
public void onUnfocus()
{
super.onUnfocus();
setBitmap(bitmap_ev);
}

public boolean trackwheelClick(int status, int time)
{
pushScreen(new Ev_class());
return true;
}
};


//CAPACITACIONES
BitmapField bitmapField_capac = new BitmapField(bitmap_capac,BitmapField.FOCUSABLE)
{
public void onFocus(int direction)
{
setBitmap(bitmap_capac_act);
}
public void onUnfocus()
{
super.onUnfocus();
setBitmap(bitmap_capac);
}

public boolean trackwheelClick(int status, int time)
{
pushScreen(new Capac_class());
return true;
}
};


//COMENTARIOS
BitmapField bitmapField_comen= new BitmapField(bitmap_comen,BitmapField.FOCUSABLE)
{
public void onFocus(int direction)
{
setBitmap(bitmap_comen_act);
}
public void onUnfocus()
{
super.onUnfocus();
setBitmap(bitmap_comen);
}

public boolean trackwheelClick(int status, int time)
{
pushScreen(new Comen_class());
return true;
}
};


//PROYECTOS
BitmapField bitmapField_proy = new BitmapField(bitmap_proy,BitmapField.FOCUSABLE)
{
public void onFocus(int direction)
{
setBitmap(bitmap_proy_act);
}
public void onUnfocus()
{
super.onUnfocus();
setBitmap(bitmap_proy);
}

public boolean trackwheelClick(int status, int time)
{
//pushScreen(new Proy_class());
return true;
}
};


//TERMINAR
BitmapField bitmapField_fin = new BitmapField(bitmap_fin,BitmapField.FOCUSABLE)
{
public void onFocus(int direction)
{
setBitmap(bitmap_fin_act);
}
public void onUnfocus()
{
super.onUnfocus();
setBitmap(bitmap_fin);
}

public boolean trackwheelClick(int status, int time)
{
//pushScreen(new Proy_class()); VOLVER A LA PANTALLA DE INGRESO
return true;
}
};


I hope your response please :p!!

Sorry for my English :p
Offline  
Closed Thread



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

Forum Jump


Vintage MAC Knife Japan 4.75

Vintage MAC Knife Japan 4.75" Folding Lock Blade Knife Chef Pocket Knife Utility

$224.99



Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower picture

Vintage MAC Tools UVEX Adjustable Safety Glasses Motorcycle Mechanic Lawnmower

$55.24



Vintage Mac Warehouse  3.5” Floppy Disk Solar Powered Calculator Company Swag picture

Vintage Mac Warehouse 3.5” Floppy Disk Solar Powered Calculator Company Swag

$74.00



VINTAGE Edmark TouchWindow Touch Window Screen IBM Mac Windows. NEW OPEN BOX  picture

VINTAGE Edmark TouchWindow Touch Window Screen IBM Mac Windows. NEW OPEN BOX

$49.99



Vintage Catalog 1985 MAC Tools Product MT86CAT Washington Court House Ohio picture

Vintage Catalog 1985 MAC Tools Product MT86CAT Washington Court House Ohio

$19.99



Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver  picture

Vintage Mac Tools AW343 Series 1/2 Pneumatic Impact Driver

$40.00







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