Variables back to the screens passage

import net.rim.device.api.ui.UiApplication;

class Startup extends UiApplication {

    String name;
    ViewScreen _vs;

    private Startup() {
        name = "initial value";
        ViewScreen _vs = new ViewScreen(name);
        pushScreen(_vs);
    }

    public void setName(String n3) {
        name = n3;
    }

    public static void main(String[] args) {
        Startup theApp = new Startup();
        theApp.enterEventDispatcher();
    }
}

/////////////////////////////////////////

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.RichTextField;
import net.rim.device.api.ui.container.MainScreen;

public class ViewScreen extends MainScreen {

    private Startup _uiApp;
    private String nameView;

    public ViewScreen(String n1) {
        nameView = n1;
        _uiApp = (Startup)UiApplication.getUiApplication();
        add(new RichTextField(nameView, Field.NON_FOCUSABLE));
        addMenuItem(changeName);
    }

    private MenuItem changeName = new MenuItem("Change Name", 11000, 10)    {
        public void run() {
            _uiApp.pushScreen(new EditScreen(nameView));
        }
    };

}

///////////////////////////////////////////

import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.AutoTextEditField;
import net.rim.device.api.ui.container.MainScreen;

public class EditScreen extends MainScreen {

    private Startup _uiApp;
    private String nameEdit;

    public EditScreen(String n2) {
        nameEdit = n2;
        _uiApp = (Startup)UiApplication.getUiApplication();
        add(new AutoTextEditField("Name:  ", nameEdit));
        addMenuItem(anotherName);
    }

    private MenuItem anotherName = new MenuItem("Another Name", 11000, 10)  {
        public void run() {
            String n4 = _uiApp.name;                    _uiApp.pushScreen(new ViewScreen(n4));
        }
    };

    public boolean onSave() {
        _uiApp.setName(nameEdit);
//      _uiApp._vs.updateDisplay();
//      _uiApp._vs.doPaint();
//      _uiApp._vs.invalidate();
        return super.onSave();
    }

}

I am new to Java and new to BlackBerry programming, so this is probably a simple question, but I'm stumped.

What is the best way to pass a variable back to the screen that has already been posted once it is published on another screen?

If you look at the three class files attached, I have a correction of exposure that shows a variable.  I then open an EditScreen, change the value and then close and save.  When the original ViewScreen appears again, it still shows the original value.  You can see the things I've tried (and commented) then the substitution of onSave, but they don't update the exposure correction.

Thanks for any input.

BlackBerry Curve 8900 v4.6.1

Eclipse 3.4.1

I thought about it.  I created variables for the fields in the first screen.  Then once you change the value of the field in the first screen, in the second screen, the field on the first screen will update as expected.

Tags: BlackBerry Developers

Similar Questions

  • While the iCloud recovery backup... continue to go back to the screen HELLO?

    I am currently trying to reactivate an iPhone with the last backup to iCloud.

    The iPhone asked me for the first update to iOS 9.3.1 (because the previous backup on previous iPhone did in 9.3.1 I guess... (and although this new iPhone showed 9.3.1!...)

    Now I'm gone screen HOLA-HELLO, entered a network wi - fi available, connected with my operator (with the right SIM card of course - phone work - test received call).

    However, now, so that this treatment with the recovery of backup, when I let the phone go to the screensaver, it keeps going back to the screen HELLO... Is * normal *?  Or should I suspect a problem with the iPhone 5?

    (Just bought from a dealer - it is seller-renovated, reliable source)

    Thank you

    Rob

    While iCloud restoration takes time - given the dependencies on your WiFi and the amount of content to download - it should not restart loop like this

    Restore your device from an iCloud or iTunes backup - Apple Support

  • When we turn on my wife's ipad, a box of red line begins to jump around the screen, and then a pale red stripe moves back on the screen. Any ideas on how to stop it? Thank you

    When we turn on my wife's ipad, a box of red line begins to jump around the screen, and then a pale red stripe moves back on the screen. Any ideas on how to stop it? Thank you

    The standard specifies:

    -Reset the device iOS. Nothing will be lost

    Device iOS Reset: Hold down the On / Off button and the Home button at the same time for to

    ten seconds, until the Apple logo appears.

    -Reset all settings

    Go to settings > general > Reset and tap reset all settings.

    All your preferences and settings are reset. Information (such as your contacts and calendars) and media (such as songs and videos) are not affected.

    -Restore from backup. See:

    Restore your device from an iCloud or iTunes backup - Apple Support

    -Restore factory settings/new iOS device.

    If still problem, make an appointment at an Apple store Genius Bar because it appears that you have a hardware problem.

    Shop Apple Store - Genius Bar

  • Windows Media Player is dragged off the screen, now I need to go back to the screen as soon as possible HELP

    SO I was using windows media player and makes it smaller.  Unfortunately I dragged off the screen too far to the right.  How get her back to the screen?  Help

    Hello

    Bring back moved off screen Windows on your desktop (keyboard Trick)
    http://www.howtogeek.com/HOWTO/Windows/bring-misplaced-off-screen-Windows-back-to-your-desktop-keyboard-trick/

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • 3 monh old oshiba lapop som numbrs & letters don had working on the back of the screen keyboard

    3 monh old oshiba lapop som numbrs & letters don had working on the back of the screen keyboard

    If it is still under warranty, contact Toshiba.

    SC Tom

  • Captivate 7 - Variables window off the screen

    When you open the variable window, the window off the screen and I can't bring it back to one of my two monitors (double).  ESC comes to Captivate, but I can't seem to locate and drag the window to the return variables.  Any suggestions?

    I can't reconnect to a third-party monitor (which I used to have).

    I assume that you have already tried resetting the workspace, CP restarted and the system?

    Try to update preferences, using the Cleanpreferences file that corresponds to your operating system, and that you will find in the Utils to the CP installation folder subfolder. ATTENTION: you will lose any customization.

    Captivate 8.0.1 Install? Keep your customization! -Captivate Blog

  • selection of the right Startup Repair boots me back to the screen to select reboot

    recently installed new graphics - no problem.

    has had to unplug my dvd player because the sata power cable is not reached. I bought a 4 pin sata converter plug in.

    Since then, I could not get into windows.

    But first, the computer would send signals to my monitor, no matter what I plugged. I have corrected it to mount tension on my diet, turn it off and set the voltage to normal... (no idea how it's fixed).

    I can get the boot screen/bios work, but then I get to the "was turned off during startup.

    start the system restart or start windows normally. If I get the startup repair it turns black for a second, and then I'm right back where I started at the same screen. If I choose start windows normally the loading bar appears and then the screen goes black.

    the first time I got it to start it says something about something not and he comes back at slow speed of DRAM. Not entirely positive, but something in this direction. I googled those terms out of memory and found it could be DQS training, but I have not overclocked or touched something like that.

    also, I had to turn my computer on and off a lot until I could get the monitor to work, so this could be a factor in this.

    on Vista 64 bit. Gateway dx4200

    just tried to get into the boot screen, safe mode requires the computer to restart.

    Thank you.

    don't know what happened, but it works again...

    Admin can mark it as resolved.

    Hello

    First thing to try is placing it back as it was before any change. Don't forget to reinstall the cards memory.
    and cables that you may have dislodged something. Which includes the removal of the video card for the test.

    If no joy then you no doubt using a computer store real (not the leeks and glances at a Best Buy
    or other stores) or Support technique Gateway.

    Check with the drivers, documentation online and Support technique Gateway.

    Gateway drivers and downloads
    http://support.gateway.com/support/drivers/dlcenter.asp

    Technical support Gateway
    http://support.gateway.com/support/?cmpid=topNav

    Door Documents
    http://support.gateway.com/support/SUPINFO/index.asp?cmpid=topNav

    I hope this helps and happy holidays!

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • Recently installed SSD, the left hand (the back of the screen) HOT

    So I recently installed an SSD in the iMac.But that I do not have a temperature sensor to be installed on the SSD.

    Spec as follow

    Ive been doing some research online and people said to avoid this direction fan / running on Full constantly to install SSD Fan Control, which i have and the fan became silent again.

    How ever look at the screen, if I put my hand up to left (rear panel) it seems to be real hot where the inverter card is I think?

    -What is normal?

    I've included some photos of SSD Fan Control temperature readings (SSD temp must be SATA as there is no sensor on it)

    I can't give you a reading temp of the left rear of the screen.

    Any information that would be great.

    Very simple, you must contact OWC (www.macsales.com) by phone and ask about their temperature sensor cable. You need to then open up and install the cable. Otherwise, your computer may overheat and cook something.

  • Gray pixels below the back of the screen onto the Satellite Pro U series

    Hello.

    After a month since the laptop purchase date, I had a problem with my screen (a black point aprox. 1 mm size - not dead pixels but something like a bug between plans display, perhaps between the trubright and the lcd screen, whatever it is these plans I don't know not-on the side rear of the screen, on the lower part), solved by Toshiba customer service using the replacement of the screen.

    But, after one more month for the replacement, the problem was once again with some minor differences.

    My screen looks like now, on the lower part of the screen (about 1-3 cm of the bottom line) a few other gray (this time) points, each with approximately 5-15 pixels of size.

    I counted to date a total of four quite visible like these bugs and a few others having no importance because of very small size, on the different areas of the screen.

    I am concerned because it seems these gray he appeared on time, more points. What mean these bugs and what solution is there?

    I want to know your guys, if anyone has a similar problem, what the problem actually is and how you can permanently solve.
    (I can not simple running again for the service because I guess I'll do every month)

    Thank you
    Iulian

    PS: Please do not ask me how to clean it's screen. It is not my bugs he and the monitor (first surface I mean) have some some dirts. I'm very cautious in this regard.

    Hello

    We could speculate about this problem, what might be wrong; Map chart or screen itself?  :| ?
    I think it s a default display

    > I want to know your guys, if anyone has a similar problem, that the root of the problem is and how you can fix it permanently.
    Personally, I've never noticed these display problems on my laptop satellite.
    I think it is foolish to discuss on the reasons why this happens it looks like simply a hardware problem. You ask how do I solve this problem?
    In my opinion there is only on the solution; replacement screen.

    Contact the ASP guy and ask for later handling.

    Concerning

  • Keeps going back to the screen "computer is not stopped correctly?

    A friend's computer won't start. When you press the power button, it loads well, until the screen where you can choose to start Windows normally, in SafeMode etc due to an improper shutdown. When you select one of the options, it is moving towards the following splash screen, but then instantly returns to the improper closing screen, when you select "normal" or "safe mode" etc. and does all over again, like a loop.

    It's Vista or 7, not sure which at the moment. No idea why?

    Hello

    Try a startup repair to see if the problem that will be solved.

    Here is the guide to Service Options while using a Microsoft Vista DVD (not the manufacturer's recovery disc).

    If a friend or a work acquantance of yours has one, you can borrow and use it for repairs.

    http://www.bleepingcomputer.com/tutorials/repair-Windows-with-Windows-Startup-Repair/

    Table of contents

    1. Overview of Windows Vista repair options
    2. How to perform an automatic repair of Windows Vista using Startup Repair
    3. Advanced Tools Overview
    4. Conclusion

    If you do not or can not borrow a Microsoft DVD there is a download of a file ISO of Vista Startup Repair available that you can put on a Bootable floppy to make the above startup repair and that the method is recommended by a large number of posters in these Forums.

    Unfortunately, you have to buy it.

    Here is a link to it:

    http://NeoSmart.net/blog/2011/Windows-Recovery-discs-updated-reinstated/

    See you soon.

  • Back to the screen with reset

    Hi people,

    in my application, there are two screens:

    -screen--> a listfield with several check box and button

    -screen B

    Users can select the checkboxes and can push a button that call anti-pop method with new screen B as an argument. When users escape in screen B key, it automatically returns to A screen with already activated checkboxes.

    My question is, how do I return to the screen in its original state (unchecked checkboxes and cuestions another)?

    I hope that I explained

    Thanks in advance,

    Kind regards!

    F.F.: Sorry for my English

    Try like this example:

    Example of display:

    public class Def extends MainScreen
    {
        public Def()
        {
            createGUI();
        }
        public void createGUI()
        {
            EditField editField=new EditField("Enter: ", "");
            add(editField);
    
            ButtonField click=new ButtonField("Click", Field.FIELD_HCENTER);
            click.setChangeListener(new FieldChangeListener()
            {
                public void fieldChanged(Field field, int context)
                {
                    UiApplication.getUiApplication().pushScreen(new SamplePopupScreen(Def.this));
                }
            });
            add(click);
        }
    }
    

    and the popupScreen is:

    public class SamplePopupScreen extends PopupScreen
    {
        Def def;
        public SamplePopupScreen(Def def)
        {
            super(new VerticalFieldManager());
            this.def=def;
            createGUI();
        }
    
        private void createGUI()
        {
            add(new LabelField("Popup Screen",Field.FIELD_HCENTER));
            //Write your code to display on screen;
        }
        public boolean onClose()
        {
            def.deleteAll();//These three steps are for reset the screen;
            def.createGUI();
            def.invalidate();
            UiApplication.getUiApplication().popScreen(this);
            return super.onClose();
        }
    }
    

    Enter something in the edit field, and then press the click to see the difference that the screen is reset or not;

  • Satellite M50 does not start, go back to the screen with different start modes

    My Satellite M50-130 does not start correctly. When you turn it on, it goes to a black DOS screen, saying: "We apologize for the inconvenience, but Windows did not start successfully. A recent hardware or software change might have caused this. "It offers me different start modes: Safe Mode, with networking and command prompt. Last good Configuration known; and start Windows normally.

    I tried all the 5 options, gets the commissioning insofar as the Toshiba screen, but then with all the options, it returns to the initial screen offering the 5 modes of starting. Same thing happens when laptop works again.

    The only recent software change, I've done was an update to Norton AntiVirus/Internet Security and I suspect that Norton is at least part of my problem, see history below. I know it's the Toshiba support site, but I tried Norton so many times without success, I gave up. Plus, I'm no expert at all, so I can't be sure that it is really the source of all my sorrows. All advice welcome!

    The performance of my laptop has deteriorated seriously in the last two months. She is extremely slow, and cleaning of malware and unwanted General does not help. It began right after that I renewed the license of Norton last year and upgraded to the 2007 version. The worst downturns are always connected to direct upcoming Norton upgrade programs. I disabled the live upgrade, but programs always come to the top, and I can't stop them, a popup tells me that they are protected.

    Wireless internet is also very capricious, even if another computer on the same network works fine.
    During the last week, I had to relax a little internet security settings (from "moderate to severe" to "low to medium") because after an other update of Norton AntiVirus, I couldn't access to interactive Web sites.
    It is perhaps a coincidence because Norton AntiVirus comes with updates at least twice a week - but what else could be the problem?

    My apologies for the long rant, I am grateful for all the advice!
    Thank you
    I have.

    Hello

    I think the only way to make your system works correctly again is to restore with the cdrom of onboard catering. Simply manage to save your data from your hard drive (the best way would be to put your machine's HARD drive in a USB - HDD enclosure and copy important data on another computer), then wipe the system completely off you hdd.

    After that, the system must run again...

    Welcome them

  • How do you get the capture of lightroom tethered floating bar back at the screen once closed

    closed the bar through the X and now I can't restore the floating bar

    A good article on attachment to the.

    Mastering Lightroom: How to tether your camera

  • Cannot navigate back to the previous screen (screen cannot be closed with the ESC key)

    Hi all

    I create simple BB app with eclipse jde 4.6.1, here the code example.

    class myApplication extends UiApplication
    {
        // applicatione entry point
        public static void main(String[] args)
        {
            // create an instance of our app
            myApplication theApp = new myApplication();
            // "run" the app
            theApp.enterEventDispatcher();
        }
        // app constructor
        public myApplication()
        {
         myScreen screen = new myScreen();
            pushScreen(screen);
        }
    }
    

    where my screen is like this

    public class myScreen extends MainScreen implements ListFieldCallback {
    private Vector menu;
    private ListField menuList;
    private MenuItem menuItem = new MenuItem("Details",100,10){
    public void run(){
    int index = menuList.getSelectedIndex();
    if (index == 1){
    Dialog.alert("list  "+index+" selected");
    }
    }
    };
    public void drawListRow(ListField listField, Graphics graphics, int index,
    int y, int width) {
         ListField menulist = (ListField) listField;
         MenuRowManager rowManager = (MenuRowManager)menu.elementAt(index);
         rowManager.drawRow(graphics, 0, y, width, menulist.getRowHeight());
    }
    
    public myScreen(){
    super(DEFAULT_MENU|DEFAULT_CLOSE);
    setTitle(new LabelField("myScreen", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER));
    
    this.addMenuItem(menuItem);
    createListMenu();
    }
    
    public void createListMenu(){
    menu = new Vector();
    menuList = new ListField(){
    protected boolean keyChar(char key, int status, int time){
    if (key == Characters.ENTER){
    // open next window
    int index = getSelectedIndex();
    switch (index){
    case 0: //
    break;
    case 1: //
    break;
    case 2: //
    break;
    case 3: //
    break;
    default: // about
    break;
    }
    }
    return true;
    }
    };
    menuList.setCallback(this);
    menuList.setRowHeight(60);
    menuList.setBackground(BackgroundFactory.createSolidBackground(Color.BLACK));
    
    // first item
    BitmapField mIcon = new BitmapField(Bitmap.getBitmapResource("image1.png"));
    LabelField lblM = new LabelField ("First list item", DrawStyle.LEFT);
    lblM.setFont(Font.getDefault().derive(Font.BOLD));
    MenuRowManager menuM = new MenuRowManager();
    menuM.add(mIcon);
    menuM.add(lblM);
    menu.addElement(menuM);
    
    // 2nd item
    BitmapField tIcon = new BitmapField(Bitmap.getBitmapResource("image2.png"));
    LabelField lblT = new LabelField("Theater Near Me", DrawStyle.LEFT);
    lblT.setFont(Font.getDefault().derive(Font.BOLD));
    MenuRowManager menuT = new MenuRowManager();
    menuT.add(tIcon);
    menuT.add(lblT);
    menu.addElement(menuT);
    
    add(menuList);
    }
    
    }
    

    and the definition of menuRowManager is like that

    public class MenuRowManager extends Manager
    {
        public MenuRowManager()
        {
            super(0);
        }
    
        // Causes the fields within this row manager to be layed out then
        // painted.
        public void drawRow(Graphics g, int x, int y, int width, int height)
        {
            // Arrange the cell fields within this row manager.
            layout(width, height);
    
            // Place this row manager within its enclosing list.
            setPosition(x, y);
    
            // Apply a translating/clipping transformation to the graphics
            // context so that this row paints in the right area.
            g.pushRegion(getExtent());
    
            // Paint this manager's controlled fields.
            subpaint(g);
    
            g.setColor(0x00CACACA);
            g.drawLine(0, 0, getPreferredWidth(), 0);
            //g.drawLine(10, 0, 10, getPreferredHeight());
    
            // Restore the graphics context.
            g.popContext();
        }
    
        // Arranges this manager's controlled fields from left to right within
        // the enclosing table's columns.
        protected void sublayout(int width, int height)
        {
            // set the size and position of each field.
            int fontHeight = Font.getDefault().getHeight();
            int preferredWidth = getPreferredWidth();
    
            // start with the Bitmap Field of menu icon
            Field field = getField(0);
            layoutChild(field, 48, 48);
            setPositionChild(field, 0, 6);
    
            // set the menu title label field
            field = getField(1);
            layoutChild(field, preferredWidth - 16, fontHeight+1);
            setPositionChild(field, 55, 30-fontHeight/2);
    
            setExtent(preferredWidth, getPreferredHeight());
        }
    
        // The preferred width of a row is defined by the list renderer.
        public int getPreferredWidth()
        {
            return Graphics.getScreenWidth();
        }
    
        // The preferred height of a row is the "row height" as defined in the
        // enclosing list.
        public int getPreferredHeight()
        {
            return 60;
        }
    }
    

    the problem is, when the first screen showed (pushed), I cannot "navigate back (close) the screen with ESC, won't my code?" Am I missing something here?

    Thanks in advance

    You want to substitute keyChar() into your custom domain.

    Don't forget that you must re - delegate all keystrokes that you do not consume.

  • With windows 7, any display (Start button, label of the file on the toolbar) moved off the screen to the left and to the right there is a black margin. How to fix?

    If I reduce the resolution, all will be displayed but smaller. I would like to keep full resolution, but back off the screen to the right. It happened all of a sudden without any modification of the navigation by me.

    Fixed, maybe the symptoms. I changed the display size of 150 to 125% in control panel - display, and the situation rectified itself. Time will tell if the fix is robust. Thank you. d

Maybe you are looking for

  • Need of recovery for Tecra S1 CD

    I can't find or I have never been a recovery CD to my Tecra S1.I need to reinstall Windows XP Home edition on my laptopHow can I get? Is it possible to download?Can anyone share with me? Please answerThank you

  • NOR-DAQmx 8.9 and 9.0.2 simultaneous install?

    I have the 2009 and 7.1 on the same machine.  When I install DAQmx 9.0.2 for 2009, all my vi acquisition for 7.1 (installed with NOR-DAQmx 8.9) will miss.  Is there a way for 7.1, 2009 and DAQmx 8.9 and 9.0.2 all to coexist on a machine?  Currently,

  • HP LaserJet 1005: driver installation does not work

    Hello I have a printer HP LaserJet 1005 of good work and I found and downloaded a driver HP Support page "HP LaserJet P1000 P1500 Hostbased Plug-and-Play basic pilot" to W8. I tried to install it but when it arrived to the point "Waiting for user to

  • 4 ultrabook split of irrelevant of envy hinged cover

    Hi, I have a HP Envy 4 Ultrabook that I bought a while back - was not a year yet. He was perfectly fine but today when I opened my screen, I heard a snapping or clicking noise and saw that my left hinge was slightly out of place, and the side of the

  • VPN authentication

    I have 2 tunnel-groups: tunnel-group test type ipsec-ra tunnel-group test general attributes address pool VPN_Pool LOCAL authority-server-group authorization-server-group (inside) LOCAL authorization-server-group (outside LOCAL) Group Policy - by def