Hi Guys
I seem to be experiencing an 'Application not responding' message with my app. I have an activity module that starts a service that will upload data every 20 seconds. The 20 second timer only starts when I get a success message in JobDone that the last update was successful. Generally, it works without problems. Sometimes though, when I click the button to start the Service, it seems like it doesn't start the service or takes a long time to start the service, which eventually results in the 'Application not responding...' message.
I used to use 'StartService' to kick off the service, but recently started using 'CallSubDelayed', which calls a sub in the service that first checks for internet connection before doing any uploads (Thinking that may have been the issue). CallSubDelayed seems to have improved the situation, but I still get the 'Application not responding...' message sometimes.
I have put ToastMessages in to indicate when the Service is created and when it starts (And when the uploads begin). I do not see these messages appear when the problem occurs, which seems to infer that the service is not being created (Not straight away anyway). There is no other code in the activity module that could hold up the main thread for 5 seconds. It's basically just a button you push to start the service. Does anyone have any ideas for me? This is quite a big problem for me as the user also often get's a black screen to accompany the 'Application not responding...' message, which sometimes lasts for quite a while meaning they cannot continue.
It will be difficult for me to load the app up as it is a private business application. It is also difficult to emulate the problem as is it doesn't happen very often.
Regards
I seem to be experiencing an 'Application not responding' message with my app. I have an activity module that starts a service that will upload data every 20 seconds. The 20 second timer only starts when I get a success message in JobDone that the last update was successful. Generally, it works without problems. Sometimes though, when I click the button to start the Service, it seems like it doesn't start the service or takes a long time to start the service, which eventually results in the 'Application not responding...' message.
I used to use 'StartService' to kick off the service, but recently started using 'CallSubDelayed', which calls a sub in the service that first checks for internet connection before doing any uploads (Thinking that may have been the issue). CallSubDelayed seems to have improved the situation, but I still get the 'Application not responding...' message sometimes.
I have put ToastMessages in to indicate when the Service is created and when it starts (And when the uploads begin). I do not see these messages appear when the problem occurs, which seems to infer that the service is not being created (Not straight away anyway). There is no other code in the activity module that could hold up the main thread for 5 seconds. It's basically just a button you push to start the service. Does anyone have any ideas for me? This is quite a big problem for me as the user also often get's a black screen to accompany the 'Application not responding...' message, which sometimes lasts for quite a while meaning they cannot continue.
It will be difficult for me to load the app up as it is a private business application. It is also difficult to emulate the problem as is it doesn't happen very often.
Regards