在我的应用程序中,我有 3 个编辑文本和一个保存按钮,我想使用 db4o 将这些值存储在单击按钮上。但它显示了一个空指针异常。
日志猫详细信息:
11-12 14:29:32.566: W/KeyCharacterMap(12122): No keyboard for id 0
11-12 14:29:32.594: W/KeyCharacterMap(12122): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
11-12 14:29:41.694: D/AndroidRuntime(12122): Shutting down VM
11-12 14:29:41.694: W/dalvikvm(12122): threadid=1: thread exiting with uncaught exception (group=0x40015560)
11-12 14:29:41.863: E/AndroidRuntime(12122): FATAL EXCEPTION: main
11-12 14:29:41.863: E/AndroidRuntime(12122): java.lang.NullPointerException
11-12 14:29:41.863: E/AndroidRuntime(12122): at java.io.File.fixSlashes(File.java:205)
11-12 14:29:41.863: E/AndroidRuntime(12122): at java.io.File.init(File.java:189)
11-12 14:29:41.863: E/AndroidRuntime(12122): at java.io.File.<init>(File.java:139)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.io.FileStorage.exists(FileStorage.java:29)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.io.StorageDecorator.exists(StorageDecorator.java:23)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.internal.IoAdaptedObjectContainer.openImpl(IoAdaptedObjectContainer.java:42)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.internal.ObjectContainerBase$1.run(ObjectContainerBase.java:140)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.foundation.DynamicVariable.with(DynamicVariable.java:54)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.foundation.Environments.runWith(Environments.java:28)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.internal.ObjectContainerBase.withEnvironment(ObjectContainerBase.java:161)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.internal.ObjectContainerBase.open(ObjectContainerBase.java:131)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.internal.IoAdaptedObjectContainer.<init>(IoAdaptedObjectContainer.java:35)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.internal.ObjectContainerFactory.openObjectContainer(ObjectContainerFactory.java:18)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.db4o.Db4oEmbedded.openFile(Db4oEmbedded.java:65)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.example.db4object.Db4ObjectsHelper.OpenDb(Db4ObjectsHelper.java:23)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.example.db4object.MainActivity$1.onClick(MainActivity.java:33)
11-12 14:29:41.863: E/AndroidRuntime(12122): at android.view.View.performClick(View.java:2485)
11-12 14:29:41.863: E/AndroidRuntime(12122): at android.view.View$PerformClick.run(View.java:9080)
11-12 14:29:41.863: E/AndroidRuntime(12122): at android.os.Handler.handleCallback(Handler.java:587)
11-12 14:29:41.863: E/AndroidRuntime(12122): at android.os.Handler.dispatchMessage(Handler.java:92)
11-12 14:29:41.863: E/AndroidRuntime(12122): at android.os.Looper.loop(Looper.java:123)
11-12 14:29:41.863: E/AndroidRuntime(12122): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-12 14:29:41.863: E/AndroidRuntime(12122): at java.lang.reflect.Method.invokeNative(Native Method)
11-12 14:29:41.863: E/AndroidRuntime(12122): at java.lang.reflect.Method.invoke(Method.java:507)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-12 14:29:41.863: E/AndroidRuntime(12122): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-12 14:29:41.863: E/AndroidRuntime(12122): at dalvik.system.NativeStart.main(Native Method)
11-12 14:29:41.963: D/dalvikvm(12122): GC_CONCURRENT freed 310K, 52% free 2733K/5639K, external 410K/517K, paused 13ms+9ms
11-12 14:34:42.160: I/Process(12122): Sending signal. PID: 12122 SIG: 9
请帮忙。