Avoiding stale data with multi-tasking
Looking for some expert advice on how to handle the situation where a user is using my app and switches focus away via multi taking and then comes back to it maybe a day later. The main tab of my app is pulling the latest news from our cms. As it stands if a user switches back to my app via multi tasking after sometime away they still see the data since they last restarted the app or clicked on the refresh button I have put in the nav bar.
I want to make things as user friendly as possible and avoid the user viewing stale data as much as possible. Reading through other posts here there is the option to disable multi tasking but that would seem to be a negative approach I would like to avoid. Another approach would seem to be to use setInterval but I don't understand how that would operate in an app with multiple tabs (news, events, directory etc).
Any suggestions on the best approach?
1 Answer
-
listen for the following events… that should get you started
Titanium.App.addEventListener('pause', function(e) { Ti.API.log('pause'); }); Titanium.App.addEventListener('resume', function(e) { Ti.API.log('resume'); });