I am using the Sensor Manager to receive accelerometer events and display the
readings from the X, Y and Z accelerometers in my application. I have a
problem where I eventually get an ANR (application not responding) and my
application is forcefully killed. The ANR reason is keyDispatchingTimedOut,
which as I understand, occurs when something is using too much of the UI
thread. The problem is, I am not doing any intensive processing on the UI
thread. I am requesting the sensor changes using SensorDelay.Ui. I've tried
a ton of different things to prevent the ANR, but it always eventually
occurs. Sometimes it takes 20 minutes to happen, but it eventually happens.
In my OnSensorChanged event, I added a check to only process the event every
250 milliseconds, but this doesn't help. 

I have data coming from other sources in my application that are updating
the UI at the same rate (or faster) and the problem only occurs when I am
responding to sensor events. The only conclusion that I can come to is that
either there is something fundamentally wrong with how I am processing
sensor events, or there is something wrong with the sensor manager. Has
anyone else seen this problem? Is anyone else responding to accelerometer
events in a similar way? By the way, this occurs on a real hardware device -
LG Optimus V.

Thanks,
Matt

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/ANR-using-Sensor-Manager-tp5637205p5637205.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to