我基于安卓软键盘开发安卓键盘。现在我添加了很多东西,我做了很多事情,键盘本身工作得很好,直到我通过手机键盘在真实设备上测试它,然后我设置了默认键盘,我进入了我去的消息应用程序检查键盘,键盘突然强行关闭。在她第一次强制关闭后,键盘工作正常。问题也崩溃了我取消选中Android的V输入设置。
然后我检查了一下,问题也是模拟器。附上日志:
首次运行时出现日志:
08-14 20:16:04.426: E/Trace(23355): error opening trace file: No such file or directory (2)
08-14 20:16:05.036: D/dalvikvm(23355): GC_CONCURRENT freed 86K, 2% free 8352K/8519K, paused 77ms+3ms, total 141ms
08-14 20:16:11.397: D/AndroidRuntime(23355): Shutting down VM
08-14 20:16:11.397: W/dalvikvm(23355): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-14 20:16:11.407: E/AndroidRuntime(23355): FATAL EXCEPTION: main
08-14 20:16:11.407: E/AndroidRuntime(23355): java.lang.NullPointerException
08-14 20:16:11.407: E/AndroidRuntime(23355): at com.thecno.smileykeyboard.Mkeyboard.onFinishInput(Mkeyboard.java:358)
08-14 20:16:11.407: E/AndroidRuntime(23355): at android.inputmethodservice.InputMethodService.doFinishInput(InputMethodService.java:1533)
08-14 20:16:11.407: E/AndroidRuntime(23355): at android.inputmethodservice.InputMethodService.doStartInput(InputMethodService.java:1542)
08-14 20:16:11.407: E/AndroidRuntime(23355): at android.inputmethodservice.InputMethodService$InputMethodImpl.startInput(InputMethodService.java:388)
08-14 20:16:11.407: E/AndroidRuntime(23355): at android.inputmethodservice.IInputMethodWrapper.executeMessage(IInputMethodWrapper.java:158)
08-14 20:16:11.407: E/AndroidRuntime(23355): at com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:61)
08-14 20:16:11.407: E/AndroidRuntime(23355): at android.os.Handler.dispatchMessage(Handler.java:99)
08-14 20:16:11.407: E/AndroidRuntime(23355): at android.os.Looper.loop(Looper.java:137)
08-14 20:16:11.407: E/AndroidRuntime(23355): at android.app.ActivityThread.main(ActivityThread.java:4745)
08-14 20:16:11.407: E/AndroidRuntime(23355): at java.lang.reflect.Method.invokeNative(Native Method)
08-14 20:16:11.407: E/AndroidRuntime(23355): at java.lang.reflect.Method.invoke(Method.java:511)
08-14 20:16:11.407: E/AndroidRuntime(23355): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-14 20:16:11.407: E/AndroidRuntime(23355): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-14 20:16:11.407: E/AndroidRuntime(23355): at dalvik.system.NativeStart.main(Native Method)
08-14 20:16:18.207: E/Trace(23400): error opening trace file: No such file or directory (2)
08-14 20:16:18.906: D/dalvikvm(23400): GC_CONCURRENT freed 93K, 2% free 8376K/8519K, paused 78ms+102ms, total 270ms
08-14 20:16:18.906: D/dalvikvm(23400): WAIT_FOR_CONCURRENT_GC blocked 5ms
08-14 20:16:19.116: D/gralloc_goldfish(23400): Emulator without GPU emulation detected.
08-14 20:16:19.276: D/dalvikvm(23400): GC_FOR_ALLOC freed 34K, 2% free 8474K/8583K, paused 55ms, total 64ms
08-14 20:16:19.276: I/dalvikvm-heap(23400): Grow heap (frag case) to 8.956MB for 662416-byte allocation
08-14 20:16:19.386: D/dalvikvm(23400): GC_CONCURRENT freed 3K, 2% free 9118K/9287K, paused 73ms+3ms, total 111ms
08-14 20:16:19.386: D/dalvikvm(23400): WAIT_FOR_CONCURRENT_GC blocked 25ms
08-14 20:16:19.876: I/Choreographer(23400): Skipped 127 frames! The application may be doing too much work on its main thread.
08-14 20:16:20.906: D/dalvikvm(23400): GC_FOR_ALLOC freed 651K, 9% free 8480K/9287K, paused 54ms, total 55ms
08-14 20:16:20.906: I/dalvikvm-heap(23400): Grow heap (frag case) to 8.960MB for 662416-byte allocation
08-14 20:16:20.946: D/dalvikvm(23400): GC_CONCURRENT freed <1K, 2% free 9126K/9287K, paused 15ms+4ms, total 43ms
08-14 20:16:20.946: D/dalvikvm(23400): WAIT_FOR_CONCURRENT_GC blocked 28ms
08-14 20:16:21.996: D/dalvikvm(23400): GC_FOR_ALLOC freed 650K, 9% free 8480K/9287K, paused 129ms, total 153ms
08-14 20:16:21.996: I/dalvikvm-heap(23400): Grow heap (frag case) to 8.960MB for 662416-byte allocation
08-14 20:16:22.136: D/dalvikvm(23400): GC_CONCURRENT freed <1K, 2% free 9126K/9287K, paused 72ms+18ms, total 134ms
08-14 20:16:22.136: D/dalvikvm(23400): WAIT_FOR_CONCURRENT_GC blocked 55ms
08-14 20:16:27.626: I/Choreographer(23400): Skipped 93 frames! The application may be doing too much work on its main thread.
08-14 20:16:27.836: D/dalvikvm(23400): GC_FOR_ALLOC freed 653K, 9% free 8481K/9287K, paused 93ms, total 96ms
08-14 20:16:27.836: I/dalvikvm-heap(23400): Grow heap (frag case) to 8.962MB for 662416-byte allocation
08-14 20:16:27.886: D/dalvikvm(23400): GC_CONCURRENT freed <1K, 2% free 9128K/9287K, paused 14ms+3ms, total 55ms
08-14 20:16:27.886: D/dalvikvm(23400): WAIT_FOR_CONCURRENT_GC blocked 38ms
取消Android键盘设置时出现日志:
08-14 20:12:47.696: W/ResourceType(23294): No package identifier when getting value for resource number 0x00000000
08-14 20:12:47.696: D/AndroidRuntime(23294): Shutting down VM
08-14 20:12:47.696: W/dalvikvm(23294): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-14 20:12:47.716: E/AndroidRuntime(23294): FATAL EXCEPTION: main
08-14 20:12:47.716: E/AndroidRuntime(23294): android.content.res.Resources$NotFoundException: Resource ID #0x0
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.content.res.Resources.getValue(Resources.java:1013)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2098)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.content.res.Resources.getXml(Resources.java:901)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.inputmethodservice.Keyboard.<init>(Keyboard.java:556)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.inputmethodservice.Keyboard.<init>(Keyboard.java:510)
08-14 20:12:47.716: E/AndroidRuntime(23294): at com.thecno.smileykeyboard.Skeyboard.<init>(Skeyboard.java:19)
08-14 20:12:47.716: E/AndroidRuntime(23294): at com.thecno.smileykeyboard.Mkeyboard.onInitializeInterface(Mkeyboard.java:83)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.inputmethodservice.InputMethodService.initialize(InputMethodService.java:646)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.inputmethodservice.InputMethodService.doStartInput(InputMethodService.java:1547)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.inputmethodservice.InputMethodService.onConfigurationChanged(InputMethodService.java:727)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.app.ActivityThread.performConfigurationChanged(ActivityThread.java:3618)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.app.ActivityThread.handleConfigurationChanged(ActivityThread.java:3746)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.os.Handler.dispatchMessage(Handler.java:99)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.os.Looper.loop(Looper.java:137)
08-14 20:12:47.716: E/AndroidRuntime(23294): at android.app.ActivityThread.main(ActivityThread.java:4745)
08-14 20:12:47.716: E/AndroidRuntime(23294): at java.lang.reflect.Method.invokeNative(Native Method)
08-14 20:12:47.716: E/AndroidRuntime(23294): at java.lang.reflect.Method.invoke(Method.java:511)
08-14 20:12:47.716: E/AndroidRuntime(23294): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-14 20:12:47.716: E/AndroidRuntime(23294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-14 20:12:47.716: E/AndroidRuntime(23294): at dalvik.system.NativeStart.main(Native Method)