Search code examples
javaandroidonresumelockscreenonpause

WidgetLocker onResume onPause


I am developing an Android application that relies heavily on the accelerometer. Because of this, I really need to make sure that the onResume and onPause events are handled correctly.

My application works perfectly when WidgetLocker is disabled, but after I lock the screen and return to the application when WidgetLocker is enabled, the application freezes, and I have to kill the process before it responds again.

My assumption is that one of the events, onPause, or onResume is not being run so the accelerometer is being registered twice, or unregistered twice.

Is there a way to make sure that the events will be hit, or program for a case when they are not hit? I have not had any trouble with other application and WidgetLocker, so I assume that I am doing something wrong.


Solution

  • I was doing nothing wrong.

    There are other documented cases of issues with WidgetLocker. For development I just disable the lockscreen. The issue described above is hardware dependent and caused by the lockscreen. Similar issues exist on my phone (HTC EVO Design 4g) when I'm playing numerous games, some professional.