09-19-2008 08:48 AM
My application return this exception when i call My previous Mainscreen
UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { UiApplication.getUiApplication().pushScreen(firsts
creen); } });
????????
09-19-2008 09:08 AM - edited 09-19-2008 09:13 AM
I'm not really sure what you are asking. You normally push the screen before starting the app.
I have something called Phlauncher that starts like the code below. invokelater is for running
"stuff" that happens while the app is running. For example, I have stuff like this line, invokeLater(new NavigateTo(url,this));
public static void main(String[] args) {
Phlauncher app= new Phlauncher(new DefPhluParam() );
app.enterEventDispatcher();
}
public Phlauncher(PhluParam pp )
{
_mainScreen = new PhluScreen(this);
_mainScreen.add(new BitmapField(_oBitmap));
// rtc=new RichTextField("loading");
pushScreen(_mainScreen);
09-19-2008 09:28 AM
hi marchywk
am calling a screen that was pused already it was in background for example my firstscreen is in background i do some stuf with my second screen after tat i calling my first screen object using
pushscrren(firstscreen);
method i got Uncaut exception attempt to push screen while already displayed wats my problem...
by..
jp
09-19-2008 09:45 AM
AFAIK you can push multiple screens but apparently it doesn't like the same screen pushed twice.
I've never had this problem as I just use one screen and modify the layout. I've actually
got my own stack of rendered fields and just change the screen layout,
Run something like this in invokelater,
_mainScreen.deleteAll();
_mainScreen.add(field);
09-19-2008 10:07 AM
jeyaprakash. How do you get from your first to your second screen?
If you do the standard BlackBerry thing, you will, from something like a menu handler in the first screen, use a push to go to the second screen. Assuming you do that, then both your screens are on the 'stack', just the second one is on top of the first one. So all you have to do is pop the second screen, and your first one will appear.
Does that help?
If not, can you clarify how you get to your second screen, and what you mean when you say your first screen is in background.
09-19-2008 10:08 AM
09-20-2008 01:23 AM
Thanku all
my problem solved i delete my activescreen using popscreen( currentscreen) before switching ..