Screen triggers Keyboard which is null on android

Hi @t0neg0d:

I’m trying to use the tonegod gui virtual joystick, and as updates come and go, I think it got broken. Below you can see the error I get. I know what is exactly is the problem by the way, so you can ask me anything.

D/dalvikvm(10192): WAIT_FOR_CONCURRENT_GC blocked 20ms
W/dalvikvm(10192): threadid=11: thread exiting with uncaught exception (group=0x41883ba8)
E/ SEVERE Exception thrown in Thread[GLThread 4218,5,main]
E/ java.lang.NullPointerException
E/ at<init>(
E/ at<init>(
E/ at tonegod.gui.core.Screen.initVirtualKeys(
E/ at tonegod.gui.core.Screen.setSpatial(
E/ at com.jme3.scene.Spatial.addControl(
E/ at co.pixelapp.savetheeggs.SaveTheEggs.initVirtualJoysticks(
E/ at co.pixelapp.savetheeggs.SaveTheEggs.simpleInitApp(
E/ at
E/ at
E/ at
E/ at
E/ at android.opengl.GLSurfaceView$GLThread.guardedRun(
E/ at android.opengl.GLSurfaceView$

The problem is here in this line:


In order for my program to run without crashing I have to comment out all the lines that have the variable “virtualKeys” in the class tonegod.gui.core.Screen. After that, my program runs like a charm since I don’t intend to use the on-screen keyboard. But this is a bug nonetheless.

I’m testing on a first generation Google Nexus 7 tablet.

These are the two lines I had to comment out:

//if (isAndroid()) initVirtualKeys();

//if (isAndroid()) virtualKeys.hide(); [/java]

Moreover, this problem doesn’t happen when I run it on my desktop. Everything works fine on my desktop.

I’m pretty good at reporting bugs, hee he.

Eh… this is due to the keyboard being tied to setUseMultitouch … for the time being, set this to true and the keyboard will be created. I’m in the process of updating this to work a little differently.

@t0neg0d I already have [java]screen.setUseMultitouch(true);[/java].

So, that’s not a quick solution.