pushscreen

Hello

I am Manager of a navigation, click the labelfield during the click on this label pushes TSTC screen field.

I don't know where area thelabel in the TSTC is not getting added to the container. I'm new to development. I enclose my code below, please help

This is the code of flight where the clickable lablefiled is code for it

LabelField lfMoreDetails = new LabelField "(more Details", Field.FOCUSABLE)
{
protected void paintBackground (Graphics g)
{
XYRect xyrect = this.getExtent ();

g.setColor (0x0060AAF0);
g.fillRect (0, 0, subTitleFont.getHeight () + 450, subTitleFont.getHeight () + 50);
g.setColor (0xffffff);
g.setColor (0xffffff);
g.setFont (subTitleFont);
int y = bigRowSpace;
g.drawText ("more details >", 10, y, Graphics.ELLIPSIS, xyrect.width-(10 + 10) "");
g.drawText (' > ', (xyrect.width - objSubTitleFont.getAdvance (">")-innerMargin), (xyrect.height > 1)-(objSubTitleFont.getHeight () > 1));
y += (subTitleFont.getHeight ()) + (bigRowSpace * 2);
}
protected void layout (int width, int height)
{
width = Display.getWidth ()-(10 + 10);
height = serviceSectionHeight;
setExtent (width, height);
}

protected boolean navigationClick (int final status, time final int) {}
TSTC TSTC = new FlightInfo(flightNo,duration,air_flight_code);
_APP.pushScreen (new FlightInfo());

fieldChangeNotify (0); / / See the difference here.
Returns true;
}

};
lfMoreDetails.setChangeListener (this);

HorizontalFieldManager hfmRow2 = new HorizontalFieldManager (Manager.HORIZONTAL_SCROLL);
hfmRow2.add (lfMoreDetails);
hfmRow2.add (clfMoreDetails);
hfmRow2.setMargin (0,0, 0, 15);
/ * vfmMoreDetails.add (lfMoreDetails);
vfmMoreDetails.setMargin (0, 0, 0, 15); * /

SF SpacerField = new SpacerField (0.20);

hfmServices.setMargin ((subTitleFont.getHeight ()) + (bigRowSpace * 3), 0, 0, 0);
vfmServices.add (hfmServices);
vfmServices.setMargin (0, 0, 0, 15);
vfmMoreDetails.add (moreDetails);

vLayout.add (vfmServices);

vLayout.add (sf);
vfmMoreDetails.add (hfmRow2);
vfmMoreDetails.add (moreDetails);

vLayout.add (hfmRow2); tmp commented

Add (vLayout);

now, I enclose the code of the screen to be pushed.

private String getAircraftAirlineDetails (String strAircraftCode, String strAirlineCode) //strFlightInfo [3]
{
System.out.println ("in getAircraftAirlineDetails:strAirlineCode:" + strAirlineCode);
Data d = null; Statement st = null; Cursor c = null;
String strAircraftDet =""; strAirLineName = "n/a";
try {}
StrURI URI = URI.create("file:///SDCard/Databases/glide/Flights_static.sqlite");
StrURI URI = URI.create ("Flights_static.sqlite");
Flights_static
System.out.println ("created - getDateLimitValue:uri");
d = DatabaseFactory.openOrCreate (strURI);
System.out.println ("open - getDateLimitValue:db");

St = d.createStatement ("SELECT date_from FROM flight_header");
St = d.createStatement ("replace SELECT (NAME_FULL, 'Passenger',") aircraft WHERE AIRC_CODE = ' "+ strAircraftCode +" ' "");

System.out.println ("created - getAircraftAirlineDetails:stmt");
St.Prepare ();
System.out.println ("prepared - getAircraftAirlineDetails:stmt");
c = st.getCursor ();
System.out.println ("found - getAircraftAirlineDetails:cursor");
Line r;
int i = 0;

While (c.Next ())
{
r = c.getRow ();
i ++ ;
strAircraftDet = r.getString (0);
}
System.out.println ("1 to try strAircraftDet:" + strAircraftDet);
System.out.println ("2 to try strAircraftDet:" + strAircraftDet);
System.out.println ("getDateLimitValue: after finished reading - strDateLimit:" + strAircraftDet);
St.Close (;d.Close());

If ((strAirlineCode!=null) & (! strAirlineCode.trim ().equals("")))
{
System.out.println ("to be strAirlineCode:" + strAirlineCode);
St = d.createStatement ("SELECT AIRLINE_NAME from airlines_list where AIRLINE_CODE ="BA"");

String strAirlineCodeNoSpace = "";
for (int j = 0; j)< strairlinecode.length();="" j++)="">
If (strAirlineCode.charAt (j) == "")
continue;
on the other
strAirlineCodeNoSpace += strAirlineCode.charAt (j);
}
If (strAirlineCodeNoSpace.length () == 2)
"strAirlineCodeNoSpace += ' '; '.
System.out.println ("to be strAirlineCodeNoSpace:" + strAirlineCodeNoSpace);
St = d.createStatement ("SELECT AIRLINE_NAME from airlines_list where AIRLINE_CODE = '" + strAirlineCodeNoSpace + "'");

System.out.println ("request for the airline name:"+"SELECT AIRLINE_NAME from airlines_list where AIRLINE_CODE = '" + strAirlineCodeNoSpace + "'");

System.out.println ("created - getAircraftAirlineDetails:stmt: query:"+"SELECT AIRLINE_NAME from airlines_list where AIRLINE_CODE = '" + strAirlineCodeNoSpace + "'");
St.Prepare ();
System.out.println ("prepared - getAircraftAirlineDetails:stmt");
c = st.getCursor ();
System.out.println ("found - getAircraftAirlineDetails:cursor");
i = 0;

While (c.Next ())
{
r = c.getRow ();
i ++ ;
strAirLineName = r.getString (0);
}
}
System.out.println ("1 to try strAirLineName:" + strAirLineName);
}
catch (Exception e) {}
Generative TODO catch block
System.out.println ("Exc while retriving getDateLimitValue:" + e);
e.printStackTrace ();
}
{Finally
try {}
if(St!=null) st.close ();
d.close () if(d!=null);
if(c!=) c.close ();
} catch (Exception e) {}
System.out.println ("Exc 2 while retriving getDateLimitValue:" + e);
}
}
Return strAircraftDet;
}

Private Sub makeDisplay()
{
System.out.println ("in mdisp - TSTC");
try {}
SF SpacerField = new SpacerField (0.20);
HeaderField header = new HeaderField ("Flight", true);

String strFlightNo ="";
/ * If ((strFlightInfo[7]==null) |) ((strFlightInfo [7] .trim (.equals(""))))
strFlightNo = "n/a";
else if ((strFlightInfo[8]==null) |) ((strFlightInfo [8] .trim (.equals(""))))
strFlightNo = "n/a";
on the other
strFlightNo = strFlightInfo [7] + strFlightInfo [8] ;*/

If (Display.GetHeight () > Display.GetWidth ())
bitBg = Bitmap.getBitmapResource ("bg.png");
on the other
bitBg = Bitmap.getBitmapResource ("bg.png");
If ((bitBg.getWidth ()! = Display.getWidth ()) |) (((bitBg.getHeight ())! = (Display.getHeight () - header.logoStripHeight)))
bitBg = BBUitility.resizeBitmap (bitBg, Display.getWidth (), (Display.getHeight () - header.logoStripHeight));
VerticalFieldManager vfmMainImgBg = VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | nouveau Manager.NO_HORIZONTAL_SCROLL)
{
protected void paintBackground (Graphics g)
{
g.drawBitmap (0,0,bitBg.getWidth (), bitBg.getHeight (), bitBg, 0, 0);
}
protected void sublayout (int width, int height)
{
Super.sublayout (width, height);
setExtent (width, height);
}
};

VerticalFieldManager vfmScrollableRegion = new VerticalFieldManager (Manager.VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLL);
HorizontalFieldManager hfmRow2 = new HorizontalFieldManager (Manager.HORIZONTAL_SCROLL);
String strAirLineName = "Jet Airways";
LabelField lfFlightDetails = getLabelValPairField (new String() {"airline:", "flight no.:","time:"},)
(New String() {strAirLineName, flightNo, duration}, 'Flight');

lfFlightDetails.setMargin (10, 0, 0, horMargin);

VerticalFieldManager vfmScrollableMnager = new VerticalFieldManager (Manager.VERTICAL_SCROLL);

vfmMainImgBg.add (space (Display.getWidth (), 10));

hfmRow2.add (lfFlightDetails);

Add (Header);   the header and the vfmMainImgBg are getting added to the screen
Add (vfmMainImgBg);
Add (hfmRow2); / / but this horizontal Manager does not have added

} catch (Exception e) {}
System.out.println ("Exc in makeDisplayy:" + e);
}

}
private getLabelValPairField LabelField (final String [] strLabels, String [] strVals, final String strTitle)
{
final String largestLabel = BBUitility.getLongestLengthtString (strLabels, null);
System.out.println ("in getLabelValPairField: largestLabel:" + largestLabel);
final int bigRowSpacing = 8, smallRowSpacing = 1;
final int valDrawableRegionWidth = Display.getWidth () - ((horOuterMargin * 2) + (horInnerMargin * 3) + labelFont.getAdvance (largestLabel));
final int drawableRegionWidth = valDrawableRegionWidth + labelFont.getAdvance (largestLabel) + horInnerMargin;
int fieldTmpHeight = subTitleFont.getHeight () + (bigRowSpacing * 4) + ((strLabels.length-1) * (bigRowSpacing));

final Vector vecVal = new Vector();
String [] strTmp;
int lines = 0;
for (int i = 0; i)< strvals.length;="" i++)="">
strTmp = BBUitility.wordWrap (strVals [i], dataFont, valDrawableRegionWidth, 0);
vecVal.addElement (strTmp);
lines += strTmp.length;
}
fieldTmpHeight += ((row - vecVal.size (()) * smallRowSpacing);
fieldTmpHeight += (lines * dataFont.getHeight ());
final int fieldHeight = fieldTmpHeight;
LabelField lfField = new LabelField()
{
Public Sub paintBackground (Graphics g)
{
XYRect xyrect = this.getExtent ();

g.setColor(0x6699FF/*0x396FC4*/);
g.fillRect (0, 0, xyrect.width, xyrect.height);
g.setColor (0xffffff);
g.fillRect (0, (bigRowSpacing * 2) + subTitleFont.getHeight (), xyrect.width, xyrect.height - ((bigRowSpacing*2) + subTitleFont.getHeight ()));
g.setColor (0x6699FF);
g.drawRect (0, 0, xyrect.width, xyrect.height);
g.drawLine (0, (bigRowSpacing * 2) + subTitleFont.getHeight () + 1, xyrect.width, (bigRowSpacing * 2) + subTitleFont.getHeight () + 1);

g.setColor (0xffffff);
g.setFont (subTitleFont);
int y = bigRowSpacing;
g.drawText (strTitle, horInnerMargin, y, Graphics.ELLIPSIS, drawableRegionWidth);
y += (subTitleFont.getHeight ()) + (bigRowSpacing * 2);

g.setColor (0x000000);
int valX = horInnerMargin + labelFont.getAdvance (largestLabel) + horInnerMargin;
for (int j = 0; j)< vecval.size();="" j++)="">
g.setFont (labelFont);
g.drawText (strLabels [j], horInnerMargin, y);

g.setFont (dataFont);
String [] strValues = (String []) vecVal.elementAt (j);
for (int i = 0; i)< strvalues.length;="" i++)="">
g.drawText (strValues [i], valX, y);
y += (dataFont.getHeight ());
If (i! =(strValues.Length-1))
y += smallRowSpacing;
}

y += bigRowSpacing;
}

}
Protected Sub layout (int width, int height) {}
Width = Display.GetWidth ()-(horOuterMargin*2);
height = fieldHeight;
Super.Layout (width, height);
super.setExtent (width, height);
}
};
Return lfField;
}

Please help me, its really urgent thanks in advance

I got it thank you friends

Tags: BlackBerry Developers

Similar Questions

  • [bbui] on bbui pushScreen

    I want the effect that cascades as much, when I click on an item, she slips into the details page.

    and when I drag to the right or click on the back button, it slips away, return to the position that I was watching.

     

    But in bbui, when I call pushScreen, it loads another page (fine there are slide effect, I know)

    but when I want to save and called popScreen(), it recharges the screen parent again and I lose the position I've read.

    In addition, no sliding effect.

    and that sucks, hope to be improved.

    Unfortunately, this is the way THAT BBUI is currently set to work. All content is loaded into the same container of the same document. Basically like a sheet of paper that keeps erasing and new content is drawn on (as opposed to switching between several sheets).

    BBUI is not currently have a mechanism in place to remind the scroll position on 'leave' a page and restore once back, so the position gets destroyed when the content is erased.

    EDIT: You could potentially include the management yourself; store the scroll position before qualify pushScreen and then restore the scroll position when the page is returned by monitoring the ondomready event.

    There are other user interface infrastructure that have included, and works to improve the offer, which BBUI provides today but I don't have a timeline on when it would be immediately.

  • BB10 - bbUI.js - pushScreen + anti-pop question

    Hi everone.

    I'm running into a problem with the functionality of pushScreen (.) and popScreen() bbUI.js. If I have an application with 3-4 + screen and push them to the screen and then try to blow up one by one I'm not able to return to the first screen, the soft seems to not respond. I have already tabled a question in bbUI.js repo but Tim has not yet responded. I have attached a small application that contains 7 screens (0-6, as the screen-table of bb.screens aura) and you can go on screen 0 to 6, then back, but if you go back 2-3 screen using the popScreen() function, it seems to freeze the app.

    I also thought that some things the listener to 'webkitAnimationEnd' is not called and thanks to this, the domReady event is not raised in bbUI.js.

    I hope you can help getting it fixed and get these use cases to work. THX

    Developer benefits other follow-up.  It seems that this problem has been fixed in the /next/ branch of bbui.js:

    https://github.com/BlackBerry/bbUI.js/issues/262

  • Problem with pop and pushScreen

    Hello everyone.

    I recently started to create an app for BlackBerry, so I'm still pretty new at this... I am having trouble with the anti-pop and pushScreen. I searched a lot but many solutions I find do not work for me. Essentially, here's what I want to do, when we click on a button, the screen must be closed (exploded view) and it must come to the screen I want that there. Here is the code im using with screen names and everything:

            ButtonField button = new ButtonField("Click!", ButtonField.CONSUME_CLICK);
    
            button.setChangeListener(new FieldChangeListener() {
    
            public void fieldChanged(Field field, int context) {
            UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());;
            UiApplication.getUiApplication().pushScreen(new LyricLordInfo());
            }
            });
    
            add(button);
    

    I want to switch from the current screen which is called 'LyricLordMainScreen' to the screen called "LyricLordInfo". I created a class to display "LyricLordInfo".

    But when I use this code, it is not to the next screen, instead it seems basically that just, it refreshes the current screen because the screen just highlights one buttons up and don't go to the screen, I wanted to.

    Any ideas on what could be the problem?

    Thank you!

    your LyricLordInfo screen seems a bit strange.
    LyricLordMainScreen extension will be very probably do not have what you want so that you do not use the super constructor that it would create.

    and why it does not contain main method? makes no sense.

    for reasons of this issue, I would say that you extend screen with LyricLordInfo.

  • passing parameters bb.pushScreen

    I looked at the examples of Tim on GitHub, but I can't for the life of understand me how to access the parameters that I'm passing to the new screen.

    I call the bb.pushscreen correctly:

    bb.pushScreen('test.htm', 'testScreen', {testvar: '#0000FF'});
    

    And I get a pop-up box appears with testvar value with the following:

    bb.init({onscreenready : function(element, id, params) {
        if (id == 'testScreen') {
            alert(params.testvar);
            }
            }});
    

    But beyond that, I can't do anything with the value.

    For example, if I add (the testdiv item exists):

    bb.init({onscreenready : function(element, id, params) {
        if (id == 'testScreen') {
            alert(params.testvar);        document.getElementById('testdiv').innerHTML = params.testvar;
            }
            }});
    

    Produces no results beyond the popup box (the page is not even forcing).

    Any ideas why this would not work?

    Got help on this topic here: http://forums.crackberry.com/blackberry-10-app-developers-f276/looking-specific-webworks-sample-bb-p... 

  • Error 104 when call pushscreen

    Hi all

    I am a beginner with RIM API, and I am developing a small application with Eclipse.

    In fact, I have a 'class hand screen', which shows my home screen, no problem for it.

    I have a button when I click on, it displays a menu with many items, I would like that this element (called 'send') show me a new screen, simply. Yes, it's simple I know but I ' v still a real problem with one exception and I don't understand why...

    Here, the function in my 'main' class who attempts to call one method from another class

    public boolean onSend(){
    
    testecran te = new testecran();
    te.affiche();
    return true
    

    and there, my class 'testecran '.

    public class testecran extends UiApplication {
    
            public void affiche() {
    
                testecran theApp = new testecran();
                theApp.enterEventDispatcher();
    
                };
    
                public  testecran(){
    
                    pushScreen(new UserInterscreen());
                }
    
        }
    
        final class UserInterscreen extends MainScreen{
    
            HorizontalFieldManager _fieldManagerTop;
            VerticalFieldManager _fieldManagerMiddle;
            HorizontalFieldManager _fieldManagerBottom;
            BitmapField _bitmap;
            Bitmap _logoImage;
            BasicEditField _input;
            int displayed = 0;
    
            public UserInterscreen() {
            super();
            LabelField title = new LabelField("Welcome",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
            setTitle(title);
    
            }}
    

    I tried to call an alert of dialogue and it is work... then there is a problem with my "pushscreen" function, I think...

    When I try to run in the Simulator, when I click on my question, in my menu, i ' v this error exactly:

    App error 104

    Eception: RuntimeException

    After many changes, I don't know why it does not work...

    Like SImon, I'm confused by the code you are using.

    I'm working on writing some tutorials designed to initiate people in the development of Java on the BlackBerry.  Attached are the first two (in fact, there is an introduction one but you don't need that).  Remember that they have not officially reviewed by anyone yet so treat with caution.  But I hope that you find them useful and they explain some of the concepts that you seem to be missing.

    At least, I think they will help.

    Please read, review and comment on tutorials and if they answer your questions.

    See you soon

    Edit:

    Attachments deleted.  I hope I can publish soon.

  • Unable to phonelistener pushscreen

    Hi all!

    Please help me with the following problem. I created an application that runs in the background at startup. I want to push a screen when a call is disconnected. I added a phonelistener and writing callDisconnected (callId) method. This method is called when the call is disconnected, which is good, but the problem is that no window does not appear after the call is disconnected. Here is the code I use for this.

    = Phone earpiece =.

    SerializableAttribute public class CustomPhoneListener extends AbstractPhoneListener {}

    main private PAP;
    call private phone call = null;

    public CustomPhoneListener (hand PAP) {}
    this.theApp = theApp;
    }

    {} public void callConnected (int callId)
    Call = Phone.getCall (callId);
    }
       
           
    {} public void callDisconnected (int callId)

    If (call! = null) {}
    System.out.println("???) -Call disconnected");
     
    theApp.requestForeground ();
           
    theApp.invokeLater (new Runnable() {}
    public void run() {}
    System.out.println("???) -Inside RUN");
    theApp.pushScreen (new TagScreen());
    }});
          
    }

    }

    = Main class =.

    SerializableAttribute public class Main extends UiApplication {}

    private static hand PAP = null;
    private ALIGRILLE screen = null;
    Private Shared CustomPhoneListener customPhoneListener;

    Public Shared Sub main (String [] args) {}
    If (args.length == 1 & args [0] .equals ('autostartup'))
    {
    Create and register the object that needs to listen for events from the phone.  Look for them
    ControlledAccessException as directed on page 69 of the BlackBerry Application
    Guide the developer, Volume 2 (Version 4.0).
    Try
    {
    PAP = new Main();
    }
    catch (ControlledAccessException (e)
    {
    Dialog.Alert ('the phone API access restricted by the system administrator.');
    System.Exit (1);
    }
    }
    else / * THIS PART IS WORKING FINE * /.
    {
    PAP = new main (new MenuScreen());
    theApp.enterEventDispatcher ();
    }
           
    customPhoneListener = new CustomPhoneListener (theApp);
    Phone.addPhoneListener (customPhoneListener);
     
    }

    main audience (form) {}
    pushScreen (screen);
    }

    public Main() {}
    }

    }

    ================= Tag Screen ==================

    SerializableAttribute public class TagScreen extends form {}
       
    private LabelField labelField;

    public TagScreen() {}
    setTitle ("Tag screen");
    labelField = new LabelField ("Hello field!");
    Add (labelField);
    }
    }

    To be more precise, immediately after you save the PhoneListener at startup, your application finishes (returns the main() method). Thus, your headset has a reference to an application that is running is no longer. Post an invokeLater application will not get what you want because the application runs is no longer (in particular, as simon_hain said, the event dispatcher didn't is more assigned to the application of the events of treatment).

  • simple pushScreen?

    Hi all.

    I develop for BB for a while and have not had the need to use the Dialog (s) so far.

    And now I'm in a bit of a quandary, because I can't get a simple pushScreen at work

    That's what I do:

    public class someClass {private UiApplication application; public someClass (UiApplication application){  this.application = application;} 
    
    public someMethod () {   synchronized(UiApplication.getEventLock())  {    try    {      application.pushScreen(settingsScreen);      //application.pushGlobalScreen(settingsScreen, 4, UiEngine.GLOBAL_SHOW_LOWER);    }    catch (Exception e)    {      throw new RuntimeException("FAILED to push settingsScreen");    }  }}
    

    After calling someMethod() first, nothing is displayed.

    Then I call it the second time, and I get the exception:

    "The attempt to push the screen so it is already displayed"!

    The exception would be ok if something was actually displayed on the screen, but it isn't.

    What did I miss?

    P.S. but if I use the commented on pushGlobalScreen() the screen. But the problem is that everything eventually (except on the end, FRO instance) dialog boxes only is shown.

    In fact

    the fact that you can combine flags did the trick:

    UiApplication.GLOBAL_SHOW_LOWER | UiApplication.GLOBAL_MODAL

    (first part says: just what is behidn this screen)

    (second part said: sulk me on top and wait to close)

    Thanks for the help!

  • After using popScreen() than pushScreen(), how to remove the fields present in this first screen.

    I have two screens, first_one contains 17 fields & by a button_presnt in the first screen, I'm reaching to the second screen, on the second screen after pop_screen (first) & push_screen (first) I get my first screen, now I want to remove 15 fields, but I face the error, this illegal argument exception, or "Try to delete a field that is not the Manager"... & Note this point I got the get_field_count from the first screen.
    Try

    {

    UiApplication.getUiApplication () .popScreen (object_to_supprot);
    UiApplication.getUiApplication () .pushScreen (object_to_supprot);
    }
    catch (Exception err)
    {
    Dialog.Inform ("page load error:" + err);
    }

    Try
    {
    Dialog.Inform ("field homepage County:"+ object_to_supprot.getFieldCount () ');

    int k = object_to_supprot.getFieldCount () - 1;

    While (k > 1)
    {
    Delete (object_to_supprot.getField (k));
    k-- ;
    }
    }
    catch (Exception err)

    {

    Dialog.Inform ("error in the setting of the key work:" + err);

    }

    I disagree with Simon here.  I think that the deletion of fields of a screen is a valid thing to do.  I can see the case when you are using the same screen, but have two different sets of data that require slightly different fields on the screen.  This is what seems to be the case here.

    I just realized what is the problem.

    your code:

    Delete (object_to_supprot.getField (k));

    must be:

    object_to_supprot. Delete (object_to_supprot.getField (k));

    Your current code is actually:

    This.Delete (object_to_supprot.getField (k));

    and 'this' is probably your second screen.  You want to remove fields from your first screen.

    Can I ask you to review my first post and Simon post, once again.  If please review how to use the battery in the display and make sure that you use it properly.

  • More pushScreen problems

    Hey all.  I can use pushScreen() successfully to make my first screen in the stack when my application starts first.  On this screen, I call pushScreen() another to push a second screen.  However, this screen does not appear on top of battery, but rather under the screen 1.  What Miss me?  Thank you for your help.

    Notice that the main application called SplashScreen, who immediately called screen.  After all, I see the SplashScreen on top, and if I close this screen, I see screen under it.  Why is he not screen on top?  Finally, how would realize that do not use the UI Thread all the time.  My understanding is that I am blocking all this code runs before enterEventDispatcher(), but I can't think otherwise.

     public class TestApp extends UiApplication {
    
        // Hook from OS to start application    public static void main(String[] args)    {        // Make a new instance of our application        TestApp application = new TestApp();
    
            // Start up the event dispatcher so we can handle events        application.enterEventDispatcher();    }
    
        private TestApp()    {           SplashScreen screen = new SplashScreen();
    
           // Push the Splash Screen onto the stack        pushScreen(screen);    }} 
    
    // Now the Splash Screenpublic class SplashScreen extends MainScreen {    public SplashScreen()     {        RichTextField helloWorldTextField = new RichTextField("Splash!");        add(helloWorldTextField);
    
            // Immediately push the HomeScreen        synchronized (UiApplication.getEventLock())        {            UiApplication.getUiApplication().pushScreen(new HomeScreen());        }    } }
    
    // Home Screen
    
    public class HomeScreen extends MainScreen{    public HomeScreen()     {          addMenuItem(new SetNewAlarm());
    
            RichTextField helloWorldTextField = new RichTextField("Home!");        add(helloWorldTextField);    }  }
    

    Your code first calls pushScreen (HomeScreen) (from the inside of the SplashScreen constructor), and then call pushScreen (SplashScreen), which makes the SplashScreen appear on the home screen.

    To repulse screens after the event dispatch loop is started, you can start pushing the screens from inside the UiApplication.activate or Screen.onDisplay (and tastes).

  • What is the right time to call the pushScreen()?

    Hello

    I made a screen that simply indicates "Loading"... "while my app works through its processes. the problem is that the screen never had pushed until after the function when pushScreen() is back. the call looks like this:

    function func() {
    
    //I'm hoping the loading screen would be pushed right here....
    
    app.pushScreen(loadingScreen);
    
    //app does its stuff
    
    return;
    
    //but instead the screen is pushed after func() finishes.
    
    }
    

    what I am doing wrong?

    Thank you

    Edit: I forgot to mention that this function if calling from a menu item, and in fact the menu itself doesn't close until after func() is done. How can I fix it?

    Or, a bit simpler:

    new Thread() {
        public void run() {
            // do the work here
        }
    }.start();
    

    Somewhere in run(), once the work is done, you can call Application.invokeLater (), passing an executable to update the UI with the results. (Alternatively, you can update the user interface of a separate thread by synchronizing on the object returned by Application.getEventLock (), but that is more complicated).

  • How pushScreen() works

    Hello

    I want to know how pushScreen() works.

    I have 5 screens that extend screen. I'm not allowing onClose() method to close the form. I put onClose() to false.

    When I first login screen appears. from there, I use pushScreen (SecondScreen()) new and like that of the second to the third, third in the fourth and

    so now. I can call her first screen again to fifth or fourth screen using pushScreen (FirstScreen()) again.

    Not where I close the screen, or use anti-pop.

    The jvm maintains all instances of screens using new, I created.

    What is the best practice to follow to push screens.

    Thank you

    Thanks for the reply.

    Now I understand clearly.

    I'll follow the way you explained.

  • pushScreen does not work when I give the screen parameters to the constructor

    I have an application that runs on a listener of the situation, and when it receives an update of location that I try to push a new screen with invokeLater.  My problem is when I add a screen with settings that never works to the pushScreen.  I tried to push another screen which takes no parameters, and it works fine.  I also tried to push a screen that has null in its settings, and it works fine.  I'm puzzled as to why this is happening, and the fact that I need gps to test very difficult debugging.  Here is a code:

    ' Public Sub locationUpdated (LocationProvider provider, a place)
    {
    If (rental. IsValid())
    {
    final double longitude = location.getQualifiedCoordinates () .getLongitude ();
    final double latitude = location.getQualifiedCoordinates () .getLatitude ();
    If (provider! = null)
    {
    Provider.Reset ();
    provider.setLocationListener (null,-1, -1, -1);
    }
    output.setText ("Longitude:" + longitude + "Latitude:" + latitude);
    UiApplication.getUiApplication () .invokeLater (new Runnable()
    {
    public void run()
    {
    UiApplication.getUiApplication () .pushScreen (new (longitude, latitude) map screen);
    }
    });
    }
    }

    Has anyone seen anything like this before?

    I was able to get an update from the location to my office with the connected debugger and realized it's my constructor.  I appreciate your help.

  • Problem with pushScreen (Screen)

    Hello

    I created a static instance of the ControlScreen class that extends from screen in class MainList.

    When I use the UiApplication.getUiApplication () .pushScreen (objControlScreen); class MainList, I see the ControlScreen with all components.

    The ControlScreen I move in the list that displays the files in the mobile. I used the RIM of fileexplorerdemo sample code.

    The problem is that when I call UiApplication.getUiApplication () .pushScreen (MainList.objControlScreen); in the list that displays the files in the mobile, I get a runtime error, and it opens a debugger. Can someone please help me solve this error, because I want to switch it back to the controlscreen after that the user has selected the file from the mobile.

    / * Control Builder screen * /.

    ControlScreen()
    {
    LabelField title = new LabelField ("Control", LabelField.FIELD_HCENTER);
    setTitle (title);
    Add (objCFSendCellInfo);
    Add (objETFSendCellInfoInternal);
    Add (objCFSirenOnLockScreen);
    Add (objCFSirenFile);
    Add (objLFSirenFile);
    Add (objETFLockScreenText);
    Add (objCFNotifyOnSMS);
    Add (objCFNotifyOnCall);
    Add (objETFPassword);
    Add (objETFPasswordToHide);
    Add (objETFPasswordToUnhide);
    Add (objCFUserNumber1);
    Add (objCFUserNumber2);
    Add (objCFUserNumber3);
    Add (objCFAttackWOutSim);
    Add (objCFAutoStart);
            
    }

    Push and a pop of work as a stack. When you tap a screen you put on top of the stack.
    you press your screen. Now you push the file Explorer screen. to return to your screen, you have just to pop, that your screen is still on the stack, just below the Solution Explorer screen.

    I would not suggest using a static context here

  • How to use the method keyDown() without pushScreen()

    Hello

    When I run my application, I don't want to, no display, so I remove the line pushScreen() of my code. But with this change, I'm not able to get the key to the convenience of right or left with keyDown() as before.

    Is there a way to get a key with no display in a foreground app?

    Thank you for your help.

    lol the exception are special keys like the end of the (green) transmission, etc (red).

Maybe you are looking for

  • Transfer of pictures to all my devices

    Apple said to iCloud photo library - Apple Support: " After taking a photo in one of my Apple devices... Is downloading pictures to all my other devices Apple ONLY after opening Photos App? Or there is an automatic background activity for download wi

  • How to upgrade firefox to my new email address?

    I have a new email address. I want to receive emails from Firefox. How can I let Firefox know what is my new email address? There must be a place to access my account in Firefox, but I don't know how/where.

  • The tabs are open not together

    I recently got a new Windows 7 laptop and decided to use Firefox Sync to move everything related Firefox above. I think that all this, and I'll go through later do not forget to add my Greasemonkey scripts and elegant. Everything was going well... un

  • gamepad Xbox 360 are not not in Device Manager

    Hello. I've been using a controller wired xbox 360 on my laptop with windows vista 32 bit 2 days ago. It worked fine, but then I was playing and all of a sudden it disconnected and my computer no longer recognizes. Sometimes it works after that I res

  • How to translate the french to the English of a pdf file

    The pdf doc is online. How to convert pdf file french to English?