Starting an other activity out of jme3 "urgent"

Ok I solved this issue.

It seems it is not possible to start an activity out of simpleapp (opengl Exception).
The trick to start an other activity is:Make use of the “extends AndroidHarness” class.
AndroidHarness extends activity so it is possible to use startActivity there.

How to handle this now?
Ppass the JME Application to the “extends SimpleApplication” class.
Writte an own method which can be called from the “AndroidHarness” class and pass the activity to it.
SimpleApplication class now have access to “AndroidHarness” methods.
Now make a normal call (simpleUpdate) in SimpleApplication class of a AndroidHarness method.

My JME3 startActivity:
[java]
package com.example.game;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;

import com.jme3.app.AndroidHarness;
import com.jme3.app.Application;

public class GameActivity extends AndroidHarness {
private GameActivity myActivity;

public GameActivity () {
    appClass = com.example.game.Game.class.getName();
    screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
    myActivity = this;
}

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((Game)getJmeApplication()).meineInitialisierung(this); //this makes the AndroidHarness class available in SimpleApplication class
}

 //this calls an other android activity class, check android developer for more help
public void startInterferenz1(){
	Intent intent1 = new Intent(myActivity, com.example.Interferenz.InterferenzActivity.class);
	intent1.putExtra("objekt",(byte)1);
	myActivity.startActivity(intent1); 
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    //getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

}
[/java]

My JME3 SimpleApplication class:
[java]

public class Game extends SimpleApplication {
private GameActivity mActivity;
//… normal code …

public void meineInitialisierung(GameActivity activity){
mActivity=activity;
}

float time=0;
Vector3f object1= new Vector3f(-343f,8.5f,224f);
boolean gameStarted=false;

@Override
public void simpleUpdate(float tpf) {
time+=tpf;
if (time>=3){
checkPosition();
time=0;
System.out.println(object1.distanceSquared(myPlayer.getWorldTranslation()));
}
if(!gameStarted){
if (object1.distanceSquared(myPlayer.getWorldTranslation())<=100f){
System.out.println(“YES!”);
gameStarted=!gameStarted;
mActivity.startInterferenz1(); //this calls the AndroidHarness class method
}
}
}

private void checkPosition(){
try{
System.out.println("myPlayer: "+myPlayer.getWorldTranslation());
System.out.println("Camera: "+camNode.getWorldTranslation());
}
catch(Exception except){
}
}
}
[/java]

woks for me :wink: