MiguelMunoz MiguelMunoz - 1 month ago 9
Android Question

Does the Back Button fail to call stop()?

My app currently has only one Form, which listens to the accelerometer sensor. In my

start()
method, I turn the listener on, and in the
stop()
method, I turn it off. I have verified that the listener turns off when I hit the Android's home button, but when I hit the back button, the application exits and the Android returns to the home screen, but the listener keeps going, which means the
stop()
method never got called. Is it my responsibility to handle the back button with code to call the
stop()
method? Or is this a bug in CodenameOne's framework? It seems to me that when the back button returns the user to the home screen, it should call
stop()
for me.

Answer

This has been fixed. I've verified it, and it works correctly now.