I am writing an application that connects to a web service in a background thread and displays the service response in the foreground activity. The app works as intended both in the emulator and on my phone via USB debugging. However, when I export the app through Eclipse, then install it on the device, it crashes with an “App is not responding. Would you like to close it?” notification.
I have two activities – a main activity with a button, which navigates to the second activity. The second activity creates a ServiceIntent, runs it and displays the result when the service call is complete.
My main trouble here is that the app fails when there is no possibility to actually debug it. I would highly appreciate it if you could point me in any direction here! Have you had this problem before?
Thanks in advance!
I have found the problem – it was an
android.os.Debug.waitForDebugger();inside theonCreate()of the service. It was making the app freeze on the device standalone, but run perfectly while USB debugging. Thank you for the help spacemanaki!