hoyeolchoi / min3d

Automatically exported from code.google.com/p/min3d
0 stars 0 forks source link

Problems with inside layout #72

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
i made a game wich is running inside a layout wich contains some buttons to 
control it. The Game takes longer to load than the layout wich appears directly 
after starting the app. If i touch the part where the game is loading, the app 
will crash. 
How can i prevent this?

Original issue reported on code.google.com by der.appb...@googlemail.com on 13 Jan 2012 at 8:02

GoogleCodeExporter commented 8 years ago
Oh i forgot the logcat. It crashes at the point where an object should be add 
to the scene. But the initScene hasnt finished so it cant show anything i 
guess. Its in the onTouchEvent wich is below the initScene. So why this works 
befor the initScene has finished :/?

01-13 21:17:20.476: E/AndroidRuntime(20189): FATAL EXCEPTION: main
01-13 21:17:20.476: E/AndroidRuntime(20189): java.lang.NullPointerException
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
com.appboss.min3d.core.Scene.addChild(Scene.java:112)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
com.appboss.soyuz.Rocket.onTouchEvent(Rocket.java:250)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
android.app.Activity.dispatchTouchEvent(Activity.java:2231)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneW
indow.java:1795)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2336)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
android.view.ViewRoot.handleMessage(ViewRoot.java:1976)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
android.os.Handler.dispatchMessage(Handler.java:99)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
android.os.Looper.loop(Looper.java:150)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
android.app.ActivityThread.main(ActivityThread.java:4277)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
java.lang.reflect.Method.invokeNative(Native Method)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
java.lang.reflect.Method.invoke(Method.java:507)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-13 21:17:20.476: E/AndroidRuntime(20189):    at 
dalvik.system.NativeStart.main(Native Method)

Original comment by der.appb...@googlemail.com on 13 Jan 2012 at 8:27