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



[java]



public class Main extends SimpleApplication{



.public static IManager x ;



}



[/java]



Then in Main Activity



[java]

@Override

public void onCreate(Bundle savedInstanceState) {



Main.x = new ConcreteManager();



}

[/java]



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: