0

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

Thanks!

user425518
  • 81
  • 1
  • 9
  • will you please elaborate it. – jmj Aug 19 '10 at 17:07
  • I have a Midlet which needs to check whether it has been automatically invoked (through a Push Registry Alarm) and perform a certain task, "A" followed by B. In the event of a manual invocation, it should proceed directly to B. If there is an intercepter to the MIDlet, it will help me achieve what I want to do. – user425518 Aug 19 '10 at 18:01

2 Answers2

1

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.

user425518
  • 81
  • 1
  • 9
0

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

plugmind
  • 7,926
  • 4
  • 34
  • 39