Setting some initial value in Main Activity

Hello Jmonkey !!!

I implement application using Jmonkey on Android which require some specific function on Android.

Therefore I create an Interface call IManager and I define it as a static attribute for GameLogic Part, for example


public class Main extends SimpleApplication{

.public static IManager x ;



Then in Main Activity



public void onCreate(Bundle savedInstanceState) {

Main.x = new ConcreteManager();



after the application run and use Main.x is used , NullPointer Exception is throws , any idea ??

Thanks in Advance

I believe onCreate the main class isn’t yet instantiated. Also, I am not sure if that “Main” variable is the right one… I know there is a variable that gets populated when the jme3 application has been started.

Then , where and when should I assign this value.?

Thank you normen :slight_smile: