我为一个游戏做了三个活动:
1. gameActivity
-- 从 databaseActivity 调用方法来更新分数 2. --- 从
3databaseActivity
调用 update 方法。 --- 有更新方法dataHelperActivity
dataHelperActivity
无法调用 datahelper
databaseActivity
,正在获取NullPointerException
.
01-25 12:22:38.352: E/AndroidRuntime(2869): FATAL EXCEPTION: UpdateThread
01-25 12:22:38.352: E/AndroidRuntime(2869): java.lang.NullPointerException
01-25 12:22:38.352: E/AndroidRuntime(2869): at com.snakegame.database.SnakeDatabase.manipulateCurrency(SnakeDatabase.java:1597)
01-25 12:22:38.352: E/AndroidRuntime(2869): at com.snakegame.classic_mode.SnakeGameWithLevelActivity$16.run(SnakeGameWithLevelActivity.java:1779)
01-25 12:22:38.352: E/AndroidRuntime(2869): at org.andengine.engine.handler.runnable.RunnableHandler.onUpdate(RunnableHandler.java:42)
01-25 12:22:38.352: E/AndroidRuntime(2869): at org.andengine.engine.Engine.onUpdateUpdateHandlers(Engine.java:596)
01-25 12:22:38.352: E/AndroidRuntime(2869): at org.andengine.engine.Engine.onUpdate(Engine.java:585)
01-25 12:22:38.352: E/AndroidRuntime(2869): at org.andengine.engine.Engine.onTickUpdate(Engine.java:548)
01-25 12:22:38.352: E/AndroidRuntime(2869): at org.andengine.engine.Engine$UpdateThread.run(Engine.java:820)
01-25 12:22:38.398: D/AndEngine(2869): SnakeGameWithLevelActivity.onPause @(Thread: 'main')
01-25 12:27:38.398: I/Process(2869): Sending signal. PID: 2869 SIG: 9