J2ME - Midlet invocation type awareness
How can a MIDlet ascertain whether it has been manually invoked or automatically?
Thanks!开发者_如何学JAVA
I can have a MIDLet with tasks A and B subclass the MIDLet with Task A and override "A" with "A + B". The auto invocation will be on the sub-class.
I presume automatic start is achieved with PUSH registry. Try this:
PushRegistry.listConnections(true);
If result is not empty application started automatically.
http://download.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/io/PushRegistry.html#listConnections%28boolean%29
精彩评论