Re-launching a MIDlet with new command line arguments

In Series 40 and Symbian, when a MIDlet is already running and it is re-launched, it is set on the foreground and can receive the new command line parameters.

In Symbian, every time a MIDlet is re-launched, the integer value in com.nokia.mid.cmdline.instance system property is incremented by one. This value can be used to check whether the MIDlet has really been re-launched or just brought to the foreground. The old values of the command line arguments are not changed unless new command line values redefine them. If JAD attribute Nokia-MIDlet-Background-Event has the value pause, the startApp method is called every time the MIDlet is brought to foreground. This provides an easy way to acquire new command line parameters.

Note: eSWT MIDlets do not support Nokia-MIDlet-Background-Event. They must detect the foreground event directly.