首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android地心引力传感器

2013-08-10 
android重力传感器为什么我在连接重力传感器时,总是出现以下错误信息: Failed to find provider info for

android重力传感器
为什么我在连接重力传感器时,总是出现以下错误信息:

 Failed to find provider info for org.openintents.sensorsimulator

04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542): java.lang.NullPointerException
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at org.openintents.sensorsimulator.db.SensorSimulatorConvenience.getPreference(SensorSimulatorConvenience.java:116)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.connect(SensorSimulatorClient.java:84)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at org.openintents.sensorsimulator.hardware.SensorManagerSimulator.connectSimulator(SensorManagerSimulator.java:188)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at com.android.DriftBall.onCreate(DriftBall.java:84)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.os.Looper.loop(Looper.java:123)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at android.app.ActivityThread.main(ActivityThread.java:4627)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at java.lang.reflect.Method.invokeNative(Native Method)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at java.lang.reflect.Method.invoke(Method.java:521)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)


04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-07 11:38:35.769: ERROR/SensorSimulatorConvenience(542):     at dalvik.system.NativeStart.main(Native Method)

04-07 11:38:36.031: ERROR/AndroidRuntime(542): Caused by: java.lang.NumberFormatException: unable to parse 'Preferences table corrupt!' as integer
[解决办法]
java.lang.NullPointerException

空指针了哥哥 
[解决办法]
虽然java不存在指针,翻译过来的意思就是没有找到相关对象
在SensorSimulatorConvenience.java中 org.openintents.sensorsimulator.db.SensorSimulatorConvenience.getPreference
就是getPreference  get不到东西

[解决办法]
NullPointerException错误和
NumberFormatException异常。
[解决办法]
传感器的类没有初始化吧

热点排行