Reputation: 280
Is it possible to delay the application closing event in windows phone. What i trying to achieve is, i need to send a web request(for sending the usage time of application) for achieving analytics in my application. So based on my current implementation before complete sending the request the main thread exits and application closes. What is the alternative to fix this issue. I cannot send the request in next application start(this fix i am not expecting)
Upvotes: 0
Views: 160
Reputation: 620
You can use the Closing
event of the application.
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff817008(v=vs.105).aspx
But you have a maximum of 10 seconds to send your data, after that os will kills your application. The best scenario is to try to send the data and flag as send if it's ok before 10s, if not, you will need to send the data at the next launch.
Upvotes: 2