java me - Multiple instances of j2me midlet problem -


I have a J2ME midlet that runs on a cell phone. This code works fine, but the problem appears. That is, this program is running more than one instance. I have the code at the beginning of the app inside the AppStart () method which runs twice when the app starts.

  Public Micros () {/ p> 

form = new form ("miegagram"); CmdClose = New command ("XIT", Command.exit, 1); Form.addCommand (cmdClose); Form.setCommandListener (this); Display = Display.getDisplay (this); Display.setCurrent (form); } Public Zero startApp () {form.append ("Start the App \ n"); // Program Program Programs}

I do not know why the code is being said twice.

I am coding on i290.

This is definitely a JVM bug startapp () at startup Calling should be made only once and can not be called by pauseApp () or call can not be made until notifiedPaused () Yourself

I recommend that the following code is:

  Private Boolean Midtown Start = Valid; Public Zero startApp () {if (MidStast Starred) {midletStarted = true; // your code}}  

In this way you can track midlet state changes, but in fact it is better that you do not use this method at all and using constructor instead Please.

Oh, by the way, I do not think there are many instances in it or something like that, this is just a JVM error.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -