How can I get a reference to the main application MIDlet object when running Codename one application on Nokia s40 device?

62 views Asked by At

I'm trying to integrate the Nokia in app purchase for s40 and Asha library to my application. The NPayManager constructor needs a reference to the running MIDlet.

1

There are 1 answers

0
Chen On BEST ANSWER

The MIDlet is passed in the init method of your main class.

public void init(Object context)

Note that you can only downcast to MIDlet in the j2me Native Interface section.Read more about native interface here - http://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html