Application for background process on auto-run-startup, we call it BG_App

For debugging I want to kill the BG_App by sending it a GlobalEvent from FG_UIApp. Ok, this works perfect. Now the BG_App doesn't run. It only runs again, when I do a full reboot. But now I would like to be able to start the BG_App again without reboot. I thought of a way like this:

user clicks the application

now checking, if BG_App is running, when it doesn't run, just start it

for the user nothing happens, so he will again click the app

now checking, if BG_App is running -> it runs, so now we can start FG_UIApp

For this I implemented the following code. Step 1 + 2 are working, but when I do step 3 the debugger tells me, that my application is already running. Is there any way to simulate the autorun-entry-point without rebooting?

Re: alternate entry point without restart

it still does not work. lets call my application "foo". I tried many different combinations with invoking foo by an application-descriptor following your provided example. It seems, that the provided example works for 3rd-party-applications to invoke ANOTHER 3rd-party-application. But it seems not to work for foo to invoke foo. In every combination I tried, every time when foo invokes foo, the debugger says:

Re: alternate entry point without restart

The behaviour you are seeing is expected. Alternate entry points do not equal 2 copies of an application running at the same time. Alternate entry points allow an application to take different actions based on how it was started.

Mark SohmBlackBerry Development Advisor

Please refrain from posting new questions in solved threads.Problem solved? Click the Accept As Solution button.Found a bug? Report it using Issue Tracker

Re: alternate entry point without restart

After playing with modifying ApplicationDescriptor it works. The solution is here:

/*my cod-module is called fooin my jde I have 2 projects - foo (the gui-application, called with no arguments) - fooautostart (the backgroundapp, called with the argument "autostart", it is generally called, when the device is booting)*/public static void main(String[] args) {if ( args.length > 0 && args[0].equals("autostart")){ new BG_App().enterEventDispatcher();}else { RuntimeStore rts = RuntimeStore.getRuntimeStore(); boolean runtimestorevalues_are_existing = false; /* now checking some values in the runtime-store,