0

私のアプリには 3 つの編集テキストと保存ボタンがあり、db4o を使用してボタン クリックでこれらの値を保存したいと考えていますが、ヌル ポインター例外が表示されています。

Logcat の詳細:

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

助けてください。

4

2 に答える 2

0

こちらこちらの例をご覧ください

これは、Android で db4o データベースを作成する際に役立ちます。

于 2013-11-12T09:08:41.193 に答える