如下錯誤:
06-08 19:59:54.367: E/AndroidRuntime(11629): FATAL EXCEPTION: UpdateThread
06-08 19:59:54.367: E/AndroidRuntime(11629): java.lang.IndexOutOfBoundsException: Invalid index 11, size is 0
06-08 19:59:54.367: E/AndroidRuntime(11629): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
06-08 19:59:54.367: E/AndroidRuntime(11629): at java.util.ArrayList.get(ArrayList.java:304)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.entity.Entity.onManagedUpdate(Entity.java:1402)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.entity.scene.Scene.onManagedUpdate(Scene.java:284)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.entity.Entity.onUpdate(Entity.java:1167)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine.onUpdateScene(Engine.java:591)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine.onUpdate(Engine.java:586)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine.onTickUpdate(Engine.java:548)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine$UpdateThread.run(Engine.java:820)
請高手幫忙解決,謝謝。
1、這是AndEngine游戲引擎,和Android完全兩回事
2、你這是在沒有加鎖的情況下remove了entity造成了線程安全問題,AndEngine cook book,你還是把這本書看完了再寫AndEngine吧