SensorEventListener no longer detecting in Android 2.3.3
I recently updated my nexus one to Android 2.3.3 and now I am unable to detect a shake with my "SensorEventListener" registered in a SensorManager. My code is close to this example to detect a shake if you want a concrete example. Thilo Köhler's shake example.
Does anyone have any ideas on this? I don't see any differences in the ap开发者_开发知识库i listed by google going from 2.2 to 2.3 or from 2.3 to 2.3.3 that explicitly talks about this. I was also unable to find any differences that talk about this.
I ended up just re-factoring everything in SensorEventListener's onAccuracyChanged to onSensorChanged. For those of you looking for a more concrete example of how to do this, here is a good example Shaker.java.
Hope this helps anyone else running into this undocumented api functionality change.
精彩评论