How to operate the main thread class when PopupScreen is pushed?

Hi all

I created shortcut menu custom in my Application. When you click the button, it shows correctly.

But in my main screen I used webservice. The screen content is watch depends on webservice respons.

My problem is that when I click on the popup button comes but threat to webservice conversation stops its execution because because of the pop-up screen my screen becomes not developed for execution. and when I remove my mainclass popup screen takes over its performance and result either appears correctly.

Please, someone tell me how could it be that in the presence of pop-up screen that my thread to call Webservice will be run?

The approach that I said is the exact stated, so my suspicion is that you have not implemented correctly.

Here's a way to test.  Add this code in any code that you are is not executed on the event Thread:

if ( Application.isEventDispatchThread() (

Dialog.alert("Oppsss, this code should not be running on the Event Thread");

}

Of course if you see the dialog box, so that the code runs on the event Thread.

If you do not, then validate your code, maybe we can find out what you did wrong.

Tags: BlackBerry Developers

Similar Questions

  • How to restore the main sites visited when opening a new tab

    I was mucking around with themes today and now when I open a new tab, it does not show my most visited sites, it shows just a blank page. I had this problem before and somewhere managed to solve this problem, but now, I went through everything & I just can't understand how it back as it was. Can someone help me? When you click on a new tab, you have pictures of the page of the most visited and most listed sites in the right part. It's NOT top sites...

    This isn't a feature of Firefox, it was probably added by the extension of the Google toolbar. Look at the parameters of the GTB.

  • How can I do to block the main thread when to display a dialog box

    I have a problem to block the user interface main thread when to display a dialog box (the dialog was created by the main Application), and when the dialog box is closed, the main Application can go to the next step.
    Here is my code:

    SerializableAttribute public class TitledPaneExample extends Application {}
    instance of TitledPaneExample private;
    StackPane mainModalDimmer;

    /*
    * (non-Javadoc)
    *
    * @see javafx.application.Application #start (javafx.stage.Stage)
    */
    @Override
    public void start (point primaryStage) bird Exception {}
    instance = this;
    primaryStage.setTitle (this.getClass () m:System.NET.SocketAddress.ToString ());

    final StackPane layerPane = new StackPane();
    layerPane.setDepthTest (DepthTest.DISABLE);
    layerPane.setStyle ("background - fx - color: BLACK ;"); ")

    Vb VBox = new VBox();
    vb.setStyle ("background - fx - color: BLUE ;"); ")
    vb.getChildren () .add new (Label ("1"));
    vb.getChildren () .add (Label ("2")) new;
    vb.getChildren () .add new (Label ("3"));
    vb.getChildren () .add (Label ("4")) new;

    Bt1 button = new Button ("bt1");
    BT1.setOnAction (new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent event)
    System.out.println ("bt1 trying to the new dialog box > > >");
    Dialogue di = new dialog box (instance, "some trick here!");
    System.out.println ("bt1 dialogue again successfully, try to show");
    di. Show();
    System.out.println ("bt1 dialog hide? < < < < ");"
    }
    });
    vb.getChildren () .add (bt1).

    layerPane.getChildren () .add (vb);

    mainModalDimmer = new StackPane();
    mainModalDimmer.setId ("MainModalDimmer");
    mainModalDimmer.setMaxSize (Double.MAX_VALUE, Double.MAX_VALUE);
    mainModalDimmer.setVisible (false);
    mainModalDimmer.setStyle ("background - fx - color: RED ;"); ")
    layerPane.getChildren () .add (mainModalDimmer);

    Scene sc = new scene (layerPane, 800, 600);
    primaryStage.setResizable (true);
    primaryStage.setScene (sc);
    primaryStage.show ();

    }

    /**
    * Display the node given as a floating dialog on the entire application, with
    * the rest of the application grayed out and blocked from mouse events.
    *
    @param message
    */
    {} public void showModalMessage (message from node)
    mainModalDimmer.getChildren () .add (message);
    mainModalDimmer.setOpacity (0);
    mainModalDimmer.setVisible (true);
    mainModalDimmer.setCache (true);
    TimelineBuilder
    . Create()
    () .keyFrames
    new KeyFrame (Duration.seconds (1),)
    new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent t)
    mainModalDimmer.setCache (false);
    }
    }, new KeyValue (mainModalDimmer
    . opacityProperty(), 1.
    Interpolator.EASE_BOTH))) infrastructure)
    . Play();
    }

    /**
    Hide the any modal message that appears
    */
    public void hideModalMessage() {}
    mainModalDimmer.setCache (true);
    TimelineBuilder
    . Create()
    () .keyFrames
    new KeyFrame (Duration.seconds (1),)
    new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent t)
    mainModalDimmer.setCache (false);
    mainModalDimmer.setVisible (false);
    mainModalDimmer.getChildren () .clear ();
    }
    }, new KeyValue (mainModalDimmer
    . opacityProperty(), 0,.
    Interpolator.EASE_BOTH))) infrastructure)
    . Play();
    }

    /**
    @param args
    */
    Public Shared Sub main (String [] args) {}
    Launch();
    }

    Dialogue/public class extends TitledPane {}
    private owner of TitledPaneExample = null;
    instance of TitledPane private;

    Dialogue (owner of TitledPaneExample, String message) {}
    This.Owner = owner;
    this.parentThreand = Thread.currentThread ();
    This.instance = this;
    this.setExpanded (true);
    this.setText ("Dialog");
    this.setMaxWidth (400);
    this.setPrefWidth (300);
    this.setMinWidth (200);

    Label the tx = new Label ("message");
    tx.setTooltip (new Tooltip (message));
    tx.setWrapText (true);
    tx.setContentDisplay (ContentDisplay.LEFT);

    Bt button = new Button ("OK");
    bt.setOnAction (new EventHandler < ActionEvent > () {}
    {} public void handle (ActionEvent event)
    masquer();
    }
    });

    Sp ScrollPane = new ScrollPane();
    sp.setHbarPolicy (ScrollBarPolicy.AS_NEEDED);
    sp.setVbarPolicy (ScrollBarPolicy.AS_NEEDED);
    sp.setContent (tx);

    Hb HBox = new HBox (30);
    hb.setPrefHeight (40);
    hb.setAlignment (Pos.CENTER_RIGHT);
    hb.getChildren () .add (bt);

    BP BorderPane = new BorderPane();
    bp.setCenter (sp);
    bp.setBottom (hb);

    this.setContent (bp);
    }

    {} public void show()
    System.out.println ("dialogue show() 1 > > >");

    owner.showModalMessage (instance);

    System.out.println ("dialogue show() 2 > > >");

    }

    public void masquer() {}
    System.out.println ("dialogue masquer() 1 > > >");
    this.owner.hideModalMessage ();

    System.out.println ("dialogue masquer() 2 > > >");
    }
    }

    }

    I'm also interested in how to do this without the use of a step.

    But, if you are ready to use a step for this, you can create a useful first step (without borders) with its owner being your current stage. Then, you can call the function showAndWait on stage that allows to block the thread of your application. For example, I implemented a DialogStage like this:

    package hs.mediasystem.util;
    
    import javafx.animation.KeyFrame;
    import javafx.animation.KeyValue;
    import javafx.animation.Timeline;
    import javafx.event.EventHandler;
    import javafx.scene.effect.ColorAdjust;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    import javafx.stage.Window;
    import javafx.stage.WindowEvent;
    import javafx.util.Duration;
    
    public class DialogStage extends Stage implements Dialog {
    
      public DialogStage() {
        super(StageStyle.TRANSPARENT);
    
        this.setTitle("MediaSystem-dialog");
    
        initModality(Modality.APPLICATION_MODAL);
      }
    
      protected void setParentEffect(Stage parent) {
        ColorAdjust colorAdjust = new ColorAdjust();
    
        Timeline fadeOut = new Timeline(
          new KeyFrame(Duration.ZERO,
            new KeyValue(colorAdjust.brightnessProperty(), 0)
          ),
          new KeyFrame(Duration.seconds(1),
            new KeyValue(colorAdjust.brightnessProperty(), -0.5)
          )
        );
    
        parent.getScene().getRoot().setEffect(colorAdjust);
    
        fadeOut.play();
      }
    
      protected void removeParentEffect(Stage parent) {
        parent.getScene().getRoot().setEffect(null);
      }
    
      protected void recenter() {
        Window parent = getOwner();
    
        sizeToScene();
    
        setX(parent.getX() + parent.getWidth() / 2 - DialogStage.this.getWidth() / 2);
        setY(parent.getY() + parent.getHeight() / 2 - DialogStage.this.getHeight() / 2);
      }
    
      @Override
      public final void showDialog(final Stage parent, boolean synchronous) {
        initOwner(parent);
    
        setParentEffect(parent);
    
        setOnShown(new EventHandler() {
          @Override
          public void handle(WindowEvent event) {
            recenter();
            onShow();
          }
        });
    
        if(synchronous) {
          showAndWait();
        }
        else {
          show();
        }
      }
    
      protected void onShow() {
      }
    
      @Override
      public void close() {
        removeParentEffect((Stage)getOwner());
        super.close();
      }
    }
    
  • How to avoid the LrStringUtils.encodeBase64 and LrFileUtils.readFile to block the main thread?

    Hello

    During the publication of the photos, I use LrFileUtils.readFile to read the exported file and LrStringUtils.encodeBase64 on the result of it. These two functions are the only ones in my process which seems to block the main thread of LR.

    I tried to put these two functions in an asynchronous task using LrTasks.startAsyncTask () and LrTasks.yield () to wait for the task at hand, but LR UI is still freezing for 1 or 2 seconds when I execute these functions.

    Is this normal? I'm doing it wrong? Is there a way I can avoid this?

    Thank you very much!

    Perhaps you need to read the file and encode it into smaller pieces (for example 100K bytes at a time), the use of Lua file: read() rather than LrFileUtils.readFile ().

  • How to operate the DVD player so that I can run DRIVER RECOVERY DVD from HP?

    Separated from this thread.

    Hello

    Thanks for the reply, I clicked on the link and it shows windows...

    Here I can not open the widows of anywhere.

    How to operate the DVD player so that I can run DRIVER RECOVERY DVD from HP

    MINE IS A VERSION OF COMPAQ PRESARIO HOME ON WINDOWS VISTA

    He always goes to startup repair

    then he said not being able to correct automatically

    Under system recovery option what can I do?

    I don't want to go back to the point of origin of the memory (factory settings)

    Thank you

    Patrick

    Hello

    Have you tried using SafeMode w/command invites to perform a system restore?

    1. Press the power button to turn on the computer.
    2. In the first screen, press the f8 key repeatedly every half second until what the Windows Advanced Startup Options screen displays.
    3. Press the arrow key down until Safe Mode with command prompt is selected, and then press ENTER. Wait while the Windows Load system files. The Windows log on screen is displayed.
    4. At the command prompt, type rstrui.exe, and then press ENTER. Wait a few moments for the system to open restore window.
    5. Follow the on-screen instructions to perform a system restore.

    You have now returned the computer to a previous restore point using Mode safe mode with command prompt.

    Using Microsoft System Restore (Windows Vista)

    http://h10025.www1.HP.com/ewfrf/wc/document?cc=us&LC=en&DLC=en&docName=c00807369

    You also have the option to create a backup of your files when you perform a recovery

    http://h10025.www1.HP.com/ewfrf/wc/document?cc=us&DLC=en&docName=c00809678&LC=en&product=18703#n405

  • PhoneListener cannot access a public static vars initialized in the main thread

    Using the emulator (SDK 4.7, phone model 9500)

    I have a class PhoneListener defined and recorded, he gets the phone events without any problems. It's all public static public var that is initialized in the main thread is always null when it is examined in the context of the PhoneListener callback thread, when examined in the main thread or a son they are defined.

    I guess since the PhoneListener callbacks are called from a system thread, it cannot access the battery of my request - it seems correct? is this in any way about this?

    I tried Application.getApplication () .invokeLater (...), but validated all executable from the PhoneListener recalled suffers from the same problem.

    Thanks - Lindsay

    Exactly, that's what I was wondering - I found the answer according to the PhoneListener in the MIDlet . Now I store my UiApplication object in the running store and access them from the PhoneLister to publish objects on my main application via invokeLater.

    Thank you

    Lindsay

  • messages between the main thread and the FX application thread

    I run a thread of the Application of FX for a main thread using Application.launch [described here: {: identifier of the thread = 2530636}]

    I try to have the application thread return information on the main thread, but Application.launch returns void. Is there an easy way to communicate between the main thread and the thread of the Application?

    So far, I googled and found:
    -MOM (Message Oriented Middleware)
    -Sockets

    Thoughts/ideas/examples are appreciated--especially examples ;)--now I try to use Sockets to show/hide the application and data transmission.

    What is the preferred method? Are there others that I did not find (gasp) via Google?

    Dave.

    Published by: cr0ck3t on April 30, 2013 21:04

    Published by: cr0ck3t on April 30, 2013 21:05

    Is there an easy way to get a reference to these objects to both the main thread and the thread of Application FX - called via Application.launch () since the main thread? Or what I need to use Sockets or MOM?

    Not much to do with the concurrent programming is what I would call easy. It looks easy - but it's not.
    You can do kind of what you're describing using Java concurrency constructs without using sockets or a package of Message Oriented Middleware (MOM).
    With the Java concurrency stuff you really implement your own form or MOM light.
    If you have quite an application is complex with many messages of comes and goes, then a sort of package for MOM such as the camel and ActiveMQ (http://camel.apache.org) is useful.
    ---------
    You can find a sample of the various interactions of thread with JavaFX here:
    https://gist.github.com/jewelsea/5500981 "Simulation of dwarf dragons using multiple threads to eat."
    Related code is just demo-ware to try different competitive access facilities and not necessarily a recommended strategy.
    If your curiosity, you can take a look and try to work out what it is, what it does and how it does.
    The main reason followed is that of a blocking queue:
    http://docs.Oracle.com/javase/6/docs/API/Java/util/concurrent/BlockingQueue.html
    ---------
    Note that once you call launch of the main thread, no subsequent statement in the main method will be different until the JavaFX application terminates. If you can't start from the main thread and communicate with the main thread JavaFX application. Instead, you need to spawn another thread (or a set of threads) for communication with the JavaFX application.
    ---------
    But really, in most cases, the best solution with the simultaneity is not care at all (or at least as little as possible). Write everything in JavaFX, use the animation of JavaFX framework to time related things and the simultaneity of JavaFX utilities for when you really need multiple interaction of wire.
    http://docs.Oracle.com/JavaFX/2/threads/jfxpub-threads.htm
    ----------
    For additional assistance, you may be better off describing exactly (i.e. really specific) what you're trying to make in a new question, perhaps with a solution of the sample in a http://sscce.org NBS

  • How to stop the open a popup when I click on an icon. I want the icon to do its job.

    How to stop the open a popup when I click on an icon. I want just the icon to do its job and open the file. However, I get the crazy popup indicating to choose the program you want to open the file.
    When we first got it it has always opened when a user has clicked on an icon. Then he started doing this several months ago, and I don't know why.
    Please help if you know how to beat this computer.
    Windows Vista Home Edition
    CEH

    Hello

    There are MANY varieties of the latter with a lot of names, but all can be removed with the
    same methods:

    Vista Antispyware 2010, XP Internet Security 2010, Antivirus 2010 Vista and Win 7 Antispyware 2010
    are rogue antivirus, scams to get you to pay for them while they have no advantage at all.

    How to remove all THE varieties of this malware - please read carefully the removal Instructions.
    http://www.bleepingcomputer.com/virus-removal/remove-antivirus-Vista-2010

    RENAME this as necessary to allow them to perform: (use a different name with the extension .COM instead of .exe)

    It can be made repeatedly in Mode safe - F8 tap that you start, however, you must also run the
    in the regular when windows you can.

    Download malwarebytes and scan with it, run MRT and add Prevx to be sure that he is gone. (If Rootkits
    UnHackMe execution)

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN

    Malwarebytes - free
    http://www.Malwarebytes.org/products/malwarebytes_free

    Run the malware removal tool from Microsoft

    Start - type in the search box-> find MRT top - right on - click RUN AS ADMIN.

    You should get this tool and its updates via Windows updates - if necessary, you can download
    here.

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN
    (Then run MRT as shown above.)

    Microsoft Malicious - 32-bit removal tool
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=AD724AE0-E72D-4F54-9AB3-75B8EB148356&displaylang=en

    Microsoft Malicious removal tool - 64 bit
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=585D2BDE-367F-495e-94E7-6349F4EFFC74&displaylang=en

    also install Prevx to be sure that it is all gone.

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN

    Prevx - Home - free - small, fast, exceptional CLOUD protection, working with other security programs.
    It is a single scanner, VERY EFFICIENT, if it finds something to come back here or use Google to see
    How to remove.
    http://www.prevx.com/   <-->
    http://info.prevx.com/downloadcsi.asp  <-->

    Choice of PCmag editor - Prevx-
    http://www.PCMag.com/Article2/0, 2817,2346862,00.asp

    Try the demo version of Hitman Pro:

    Hitman Pro is a second scanner reviews, designed to save your computer from malicious software (viruses,
    Trojan horses, rootkits, etc.). that has infected your computer despite all security measures that you have
    taken (such as the anti-virus software, firewall, etc.).
    http://www.SurfRight.nl/en/hitmanpro

    --------------------------------------------------------

    If necessary here are some free online scanners to help the

    http://www.eset.com/onlinescan/

    http://OneCare.live.com/site/en-us/default.htm

    http://www.Kaspersky.com/virusscanner

    Other tests free online
    http://www.Google.com/search?hl=en&source=HP&q=antivirus+free+online+scan&AQ=f&OQ=&AQI=G1

    --------------------------------------------------------

    Also do to the General corruption of cleaning and repair/replace damaged/missing system files.

    Run DiskCleanup - start - all programs - Accessories - System Tools - Disk Cleanup

    Start - type this in the search box-> find COMMAND at the top and RIGHT CLICK – RUN AS ADMIN

    Enter this at the command prompt - sfc/scannow

    How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
    generates in Windows Vista cbs.log
    http://support.Microsoft.com/kb/928228

    Run checkdisk - schedule it to run at the next startup, then apply OK then restart your way.

    How to run the check disk at startup in Vista
    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    -----------------------------------------------------------------------

    If we find Rootkits use this thread and other suggestions. (Run UnHackMe)

    http://social.answers.Microsoft.com/forums/en-us/InternetExplorer/thread/a8f665f0-C793-441A-a5b9-54b7e1e7a5a4/

    I hope this helps.

  • Running the thread of the child until the end even after that the main thread is terminated

    I run a background task by using the task and the Service Api. When the main application creates little son, the main thread can be terminated without completing the child thread. Is this possible. Thank you.

    Find out about the son of the devil.

    Multithreading - what is Daemon thread in java - Stack Overflow

    Read also the

    Application section of the lifecycle in the javadoc.

  • How to make the background hover over when a clip hits the edge

    OK, so the idea here is to make a page with content written on it. the conent will not be able to be seen, unless the user presses the arrow keys on the key board there. So I need to make a group of objects, I can do in a clip and that in this clip from movie that an animation that plays the works of the squirrel. I will pause here to ask two things I don't know how I want the squirrel to have an animation when you are still where it moves its tail (like a real squirrel). and also how would flip the squirrel so that when the left is pressed it left points and when the right arrow is it press faces to the left? and my main question when it reaches the edge of the extensive background scene that runs off the stage hovers over to reavel more content. as well as not have not the squirrel run off the stage? In short, I use the squirrel to display the content of entire pages.

    You ask for a little and are not likely to get anyone to give you a detailed solution.  Here are a few things to think about.

    As far as flicking the tail goes, is something you have to work as an animation.  You could do as a scenario animation or animation coded when you adjust the rotation, and other properties of the tail.

    Get the object to do ican facing left and right to be a simple matter of replacing its xscale 1-1 property according to the way in which it is normally facing (1).

    If you do not have a problem doing the squirrel to move to the edge, then you should have no problem doing the background move either.  You just constantly check the squirrel x property to know when it hits the edge.  Personally, I would only move the background and leave the squirrel in the Center.

  • How to choose the display by default when you use two screens on my Mac Pro?

    How to choose the display by default when you use two screens on my Mac Pro?

    The default view when you have several is made that you drag the little icon in the menu bar in this pane:

    .

  • How to fix the main button to paste constantly

    How to fix the main button to paste constantly

    Short of getting a replacement from Apple or risk a repair third shop there is nothing you can do. How about a button on the home screen? Go to settings > general > accessibility > assistive touch > on.

  • How to access the tab 'Save all' when I close several jpeg files that have been adjusted with the "color adjust tool? He is currently making me close and save one at a time. Thanks for any help :)

    How to access the tab 'Save all' when I close several jpeg files that have been adjusted with the "color adjust tool? He is currently making me close and save one at a time.  I've just upgraded to El Capitan.  Thanks for any help :)

    I assume that you use the application overview.

    I can't find an answer to back up everything, but a workaround could be while the file menu options are visible, press the option key

    and the point of the window will become close, if you click on that dialogue will ask you if you want to restore the changes or save

    pressing Save will close the image with the changes and then move to the next image and so on.

  • How to disable the connection of identity when opening Outlook Express

    How to disable the connection of identity when opening Outlook Express

    In OE: File | Identities | Manage identities | Properties and uncheck the option to require a password.

  • How to change the programs that load when Windows starts

    In simple terms... How to change the programs that load when Windows starts?  Because my boot time is slow in arriving at my login screen!

    Download and run the "Autoruns" from Microsoft Sysinternals freeware:

    < http://technet.microsoft.com/en-us/sysinternals/bb963902="">

    It lists all programs that start at startup and allows you to disable it by simply removing a check mark.  This makes it easy to reverse in case something goes wrong.

    HTH,
    JW

Maybe you are looking for