How to access intent related variables in jMonkey AppStates?


I want to access variables passed via android intents in jMonkey app. I can access these variables using the typical intent variable reading code in the MainActivity

[java] @Override
public void onCreate(Bundle savedInstanceState) {
Bundle parameters = getIntent().getExtras();
if (parameters != null) {
String name = parameters.getString(“myextra”);
//Integer age = parameters.getInt(“age”);

However I want to access these variables in the jMonkey AppStates but I don’t know how to pass references of the object holding these variables to jMonkey system. I can’t access AppStateManager from the MainActivity and I can’t access JmeAndroidSystem reference from the AppState using the JmeSystem object.

Is there a good way of this communication instead of hacking the AndroidHarness and JmeSystem code to make the JmeAndroidSystem visible.

@simar.i3r said: I can't access AppStateManager from the MainActivity

Doing it this way around is backwards, you should not make the whole application depend on one deployment system, check out the manual on this topic: