How to avoid creating multiple instances of the application?

Hello

We have a user interface Application. The application has been set to Auto run at startup and as a Module system.

The application has a file listener that checks all new emails.

When we start the application from the user interface by clicking on the application icon, it seems that the multiple instance of the application is created. For this reason when send us an email to request it is receiving emails several times. Sometimes simple, double and sometimes even five times.

public class MyApplication  extends UiApplication implements FolderListener,
        SystemListener, GlobalEventListener {

    // Boot
    public static void main(String[] args) {
        if (args != null && args.length > 0 && args[0].equals("gui")) {
            // code to initialize the app
            fromService = false;
            // register the notification
            Notification n = new Notification();
            n.registerNotificationObjects();

            Utilities.writeLog(GUID, "MyApplication GUI Starting up");
            MyApplication service = new MyApplication();
            service.enterEventDispatcher();
        } else {
            Utilities.writeLog(GUID, "OnBoardV2 Service Starting up");
            MyApplication service = new MyApplication();
            service.enterEventDispatcher();
        }
    }

    public void messagesAdded(FolderEvent e) {
        /// Receive messages
        }   

}

In this regard, any help will be apreciated!

Thank you

I don't know if it's your entire code, but if you register your application as a file time listener never, it is called, then you save several headphones. The listener does not cause deleted your app closes, you must explicitly remove the listener. You must either put the listener in its own class and only sign up to start or find a way to check if the listener is already registered whenever the application is called.

Tags: BlackBerry Developers

Similar Questions

  • How to programmatically create an instance of the target

    Is there a way to create an instance of the target programmatically. Basically, I have a goal which, in the addition of the target manually, create and instantiate a subtarget including metrics gives the availability. Is there a way in which I can programmatically create an instance of the target.

    I felt the portions of automatic detection of the chapter helped me to meet my needs. Instances of targets could be created as part of the discovery process and thus made available during the process of guided discovery.

  • Multiple Instances of the Application to access the same DAQ hardware

    I have a relatively simple application that reads from a device of data acquisition (OR-9205 connected to NI WLS-9163) wireless.  I would like to run multiple instances of the executable, but I get the error-201105 (resource reserved) as soon as the DAQmx task starts on the second instance.  Each instance tries to acquire different channels of the same DAQ hardware.  Is this a problem with the data acquisition device, or DAQmx in general?  Thank you.

    -Joe

    Hey Joe,

    Unfortunately, you can only one type of access channel with each program.  For example, you might HAVE a program access and another use AO, but you can't have two programs different AI the same access card.  It is common among all of the DAQ hardware to NEITHER.

  • How to make a single instance of the application regardless of the main application and the other entry point for the application

    Hello experts,

    I explain the sceniro of my application. My request is mainly a time system as well as some other features related businesses. My app has a landing screen which is actually a custom made calendar that accumulates information captured time. There is also a time where entry screen user at will has worked time and other related information. The user has the option to run the application manually at the entrance of the time and see the reports and there the event listener to follow the events of call/SMS/e-mail that invokes the application automatically and user to the scree of time entry.

    Problem one: I used headphones to follow the events of call/SMS/e-mail. When an event is called, alternet point of entry of the application the application is running. Application then get calls time, contact information etc. and push my entry screen with pre-filled information time.

    As such, it works very well, as expected, but the problem is the number of instence that he is creating. Each track event creates a new instance of the application. I want to keep only one instance.

    Two problems: to solve this problem, I removed the other point of entry and RuntimeStore to keep the running instance of my application. This instance of the application in a way keeps in singletone as such when the listener calls the application it finds that the application is running in the background. Then she moves the application to the foreground. It works very well, I mean the application user interface called on the foreground, but he won't have to time entry screen automatically as I hope. The block of code is as follows,

    public static final long applicationID =0x8ddc44508679bd5bL;
    static NSIApplication NSIInstance=null;
    RuntimeStore runtimeStore = RuntimeStore.getRuntimeStore();
    
    if (NSIInstance != null)
                {
                    NSIInstance.requestForeground();
                }
                else
                {
                    synchronized (runtimeStore)
                    {
                        NSIInstance = (NSIApplication)runtimeStore.get(applicationID);
                                            //listener initialization
                        NSIListener.Initialze();
                    }
    
                    if (NSIInstance != null)
                    {                   NSIInstance.requestForeground();
                                        //event's info manipulation and push the time entry screen                                     NSIInstance.RUN_NSIApplication();
                    }
                    else
                    {
                        NSIInstance=NSIApplication.getInstance();
                        NSIInstance.RUN_NSIApplication();
    
                        synchronized(runtimeStore)
                        {
                            runtimeStore.put(applicationID, NSIInstance);
                        }
    
                        NSIInstance.enterEventDispatcher();
                    }
                }
    

    I expect a guideline to follow so that I can reach the expected my workflow. Thanks in advance

    I can't propose to use the runtimestore to store instances of the application, as it was used on an example RIM, he has never worked for me.

    I suggest to use a single point of entry and the automated screen using a global event or status in the runtimestore.

  • IOM SysAdmin does not create an instance of the application

    Hey guys,.

    I created a connector ICF personalized according to the guide to the resources page for Oracle dev (icf-connector-development-1868156). I have completed the coding and have created the appropriate metadata integration via the Console Design and am stuck in one of the tasks that must be done through the Console of SysAdmin IOM. I managed to create both the resource and the instance of the application for my connector, but after that I saved the instance of the application, the user interface does not show the button to create a form - only inactive "Edit" and the "Refresh" button on the button which has no effect.

    If the user interface behaves as if a form has already been created, but no entry appears in the drop-down list of 'form '.

    I just finished this process several times before but I have never seen this behavior.

    Can you help me with this problem?

    The more in advance thank you!

    Best regards

    Hello

    I believe that similar kinds of problems with one user.

    Re: Not able to choose the form in the instance of the application

    Not sure if it has been resolved or not. You can also check with any other env as well?

    ~ J

  • How to programmatically get all instances of the application in the IOM?

    Hello experts,

    Is there a way I can get in a programmatic manner, all instances of the application?
    If so could you please give a code snippet?

    Best regards!

    Carol

    something like below

    import

    Import oracle.iam.provisioning.vo.ApplicationInstance;
    Import oracle.iam.platform.entitymgr.vo.SearchCriteria;
    Import oracle.iam.provisioning.api.ApplicationInstanceService;

    Code appInstance

    ApplicationInstanceService appInstanceService = (ApplicationInstanceService.class) Platform.getService;
    String appInstanceName = "appInstanceName;
    Criteria of SearchCriteria = new SearchCriteria (appInstanceName, "*", SearchCriteria.Operator.EQUAL);
    The list of results of ;
    results = new ArrayList ();
    results = appInstanceService.findApplicationInstance(Criteria,null);

    "Criteria such as ' *' for all the appinstance".
    String appInstanceName = "appInstanceName" / / it's to another ApplicationInstance.APPINST_NAME
    Criteria of SearchCriteria = new SearchCriteria (appInstanceName, "*", SearchCriteria.Operator.EQUAL);

    Pass NULL to ConfigParams

    you will find the appinstances all

    -nayan

  • How to avoid multiple instances of the application

    Hello

    I would like to know how I can to avoid multiple instances of my request, my application have an option to "invoke later" which will awaken the application after xx minutes but where the user clicks on the icon of the application, for example, a few seconds before he must wake up he will see 2 instances open my application.

    Currently, the work around I did is check at every opening, if there is already an open instance and if so to 'kill' later, but I would like to know if there is a more elegant way to do it.

    THX.

    You create a new ApplicationDescriptor - you say the BlackBerry OS that it is a new Application.

    If you use this method, and then the user clicks on the new icon, they will get also running two instances.  Here is a code that restarts the application 'running', that I think that it what you want.

    ApplicationDescriptor current = ApplicationDescriptor.currentApplicationDescriptor ();
    ApplicationManager.getApplicationManager (.scheduleApplication) (current, System.currentTimeMillis (+ 2001), true);
    System.Exit (0);

  • Click and drag the shape tool creates multiple instances (w / photos)

    When I click on and drag a shape tool, illustartor creates multiple instances of the object, such as a card when you earn solitare.

    No idea what could cause this?

    Is your tilde ~ key down, or you have any plug ins installed that may be corrupt you system?

  • BPEL is create multiple instances of a single HTTP OSB call

    Hello

    Here, I describe how looks like my flow of integration.


    (1) proxy OSB service calls service BPEL (HTTP protocol for help)

    (2) BPEL called two services to OSB using HTTP calls (these two OSB services will insert the data into two tables)

    (3) according to my testcase an OSB service should be managed and second service OSB must fail, so any integration does not work as expected

    (4) but the second OSB service takes 2 minutes when inserting data into the database

    (5) in 2 minutes BPEL is creating an instance more

    How to stop creating multiple instances.

    Thank you and best regards,

    Harsha.

    Automatic recovery is enabled by default in bpel, you can try catch the fault. You can also change the value of MaxRecoverAttempt please go through this link: https://svgonugu.wordpress.com/2013/05/08/auto-recovery-feature-in-bpel/

    Kind regards

    Anshul

  • Use of multiple instances of the same browser...

    Hi people,

    I have a question...
    I inherited a large APEX application, it uses Oracle SSO to log.

    We are migrating the application to a new set of servers and run regression tests.
    Testers are connecting using IE6 and multiple instances of the application both on the oldTest newTest servers and opening.

    If at some point, you can:
    an application Admin user (username ADMINTEST123)  logged into the application on oldTest
    an application Admin user (username ADMINTEST123)  logged into the application on newTest
    
    an application standard user (username TEST123)  logged into the application on oldTest
    an application standard user (username TEST123)  logged into the application on newTest
    Is this supported?

    Could someone tell me or direct me to the documentation or the thread that lists which is supported / unsupported for use of browser with APEX and SSO?

    Thanks in advance,
    Gus...

    So this can I conclude that what you say and the above results we could get questions if connection users and open new windows in this sense?

    Yes, if users connect or not, if requests for pages using the same session of apex are issued different browser instances, the results may be undesirable.

    Scott

  • Get the name of the Instance of the Application in an IOM PrePopulationAdapter

    We have at disposal of the IOM to multiple Active Directory domains. To do this, we installed a connector AD, Multiple Instances of the Application of several Instances of IT resources, while using one and the same resource object and form. Self-service console we want to request an account (Instance of the Application) to a user, and we can choose AD1, AD2, and AD3. When we choose, lets say, AD3 do we want to pre-fill the field organization name (OU in AD) with a specific organizational unit in Active Directory corresponding to the Application Instance AD3. The problem is that in the PrepopulationAdapter we have not managed to identify the instance of the application of demand.

    Here's how to get the instance of the application of demand in an adapter to prepopulate:

    prepopulate (RequestData requestData) serializable public get {RequestServiceException}
    String response = "";
    RequestBeneficiaryEntity targetEntity = requestData.getBeneficiaries () .get (0) .getTargetEntities () .get (0);
    EntityType of OIMType = targetEntity.getRequestEntityType ();
    If (entityType! = OIMType.ApplicationInstance)
    Return ' ';

    try {}
    String entitySubType = targetEntity.getEntitySubType ();
    ApplicationInstance appInst is getAppService () .findApplicationInstanceByName (entitySubType);.

    .... Continue your own code

    getAppService is the ApplicationInstanceService API.

    -Kevin

  • How to prevent a user from opening multiple instances on the same computer?

    On site oldnavyweekly.com , there is a .swf which prevents users to open multiple instances of the site at the same time on the same computer. If you open the site and try to open it again in another window, it will not load. Cannot open the site again until the first window is closed. How did they implement this?

    My analysis, that is NOT:
    1. cookies - the block always takes place if you try to open it in Internet Explorer and also try to open it in Firefox at the same time.
    2 flash Cookies - the block always takes place if I disable flash cookies.
    3 IP Based Block - you are not blocked if you open the site on two separate computers with the same outgoing IP address. From my analysis, their server does not help in the block at all.

    It seems as if their .swf creates a sort of object throughout the global system which can be detected in other instances of the application on the same computer. How did they implement this?

    Thank you!

    use localconnection.  everyone has a localconnection to send and a receiving localconnection.  the lc reception closes the current application.

  • How can I play multiple instances of video to classic media player in Windows xp help, that I could do so some time! It has to do with the codec? If yes what codec plays multiple instances?

    How can I play multiple instances of video (no problem reading of 12 movies at the same time, at the opening of the 13th film the problem only starts), the classic use of media player in windows XP? I was able to do all the time! It has to do with the codec?
    If yes what codec plays multiple instances of Media Player Classic in windows XP?
    I get the same problem with VLC all that needs to be checked on preferences is checked in the two VLC & MPC!

    Hello

    Multiple instances of Media Player is not supported in version 7 and greater.

    · What version of Windows Media Player you have installed?

    · Are instances that you are referring to the bodies shipped?

    · You use any third-party software to run multiple instances?

  • Creating multiple instances of a custom taskflow: how?

    I use JDEV 11.1.1.5.0 and we use WebCenter PS4.


    Our previous developer created a calendar countdown / count down timer. When I try to create a copy of it from within Web Center Mashup > task flow page I have a few problems:

    1. If I change the settings of task flow, such as the title or the time format (minutes, hours, or days are the options) - these changes do not appear on the page itself. He always uses the same values as the original task flow that I copied from.

    2. I've noticed that in the Page Fragment and the definition of the taskFlowId Page points to "/ WEB-INF/ScheduleWidget #ScheduleWidget. Id = "' is the same for each completed copy of the original workflow."


    What I would do, is to have the ability to create multiple instances of this workflow even at the breast of a single space, but right now they are the only things that stop to occur.

    Hello

    JavaScript does not have workflows and so is not isolate the invocations to son. Bottom line is that your use of JS must be improved.

    Actually what you are calling a single JavaScript function, which will exist only as a single instance on the page. What you need to do is rather than for each call JS workflow, you must create a separate JS object that is then used with this workflow. Ultimately you would have as many instances created JS object as task on one page (at the moment you don't have that, and instead, you use a single variable). As I see it, what you have to do is

    -for starting workflows, call JS in Java (or a region controller)
    1. create a new object ' cdtime ($(this) new.attr("id"), ' ${pageFlowScope.counterDate} ");
    2. register the object in a variable of page with a key identifying the workflow as it is used with/for the
    -Workflow then use you the client listener to access the timer for this workflow. For example, you can pass an argument to the JS function so that he knows which instance of timer for your registry level JS page object (probably a map)

    Frank

    Published by: Frank Nimphius, February 23, 2012 10:33

  • Unique VO shared by multiple instances of the same taskflow

    Hello Experts,

    Need your expert opinion to this problem. I have a VO that is used to display the details of the master-child table on page jsff (say it as a Page of country-state).

    The user comes to the jsff by taskflow launch page, passing a search results table (say it as countries search result). I have provided hypertext links in the table of countries so the user can click on the name of country and go to the country-state page.

    Occurs when the user clicks on the links from different countries and thus to open several pages of country-state jsff. In this case, all the pages pointing to the same country-state record.

    Example; Search country table has three rows - India, China, Japan. User clicked on the India, China and Japan of the Web links provided in the table. He opened 3 pages of the table of State of the country. But all these pages show details of the Japan as he was finally activated.

    I'm new to ADF and it's the first assignment . I learned and put in place through blogs on the internet but stuck here now.

    Appreciate any help.

    PS - I've seen a few articles mentioning to create multiple instances of VO, but my problem is that I don't know how many instances of create. Because it depends on how many times users click on hyperlink and launch taskflow.

    Kind regards

    Newbie

    This is not a property of the vo but the workflow. Please watch this http://www.youtube.com/watch?v=SHfilCAVzTs video that shows the concept.

    Timo

Maybe you are looking for