I have an android app which turns on a sensor on my device and collects data, the data is then sent via http requests and a response is returned back to the app.
However when the back button is pressed it doesn't go back to the home page of the app, instead it crashed with:
unfortunately app has stopped
And I get these errors:
If I press the back button before data gets collected then the app goes back properly to the home screen.
It seems that the ServiceConnection
class is still running which is causing the error.
Any suggestions would be great,
Thanks so much!