views:

20

answers:

2

How can a MIDlet ascertain whether it has been manually invoked or automatically?

Thanks!

+1  A: 

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.

A: 

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

radek-k