Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Carrier: Movistar, Telenor
Accepted Solution

Program not ending?

I have a small program that should just start up my phone listener and then end. I know I am rusty on Java but why does it not end? Apart from that it works as I want.  If I try to start it again it says "Middleman already running". Its not set as system or autostart

 

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

 

import net.rim.device.api.system.*;
public class Middleman extends Application
 {
   public static void main(String args[])
    {
     Middleman theApp = new Middleman();
     theApp.enterEventDispatcher();
    }
   public Middleman()
    { 
     try
      {
       System.out.println("Entering Middleman<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");  
       int modHandle = CodeModuleManager.getModuleHandle("MonitorNotAuto");
       ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(modHandle);
       ApplicationManager.getApplicationManager().runApplication(apDes[0]);      
      } catch (ApplicationManagerException e)
        {
           System.out.println("Could not start MonitorNotAuto<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
        }  
      System.exit(0);  
    }
 }

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Carrier: Movistar, Telenor

Re: Program not ending?

Fixed.

 

Not sure exactly  what did it, I restructured it a bit and put the try block in a new routine

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Please use plain text.