Problem description
When you are in an app, and you press the lock button (hardware top right button) and then unlock, the app is not throwing the resume event.
Actual results
The app doesn't throw the resume event after unlocking the screen.
Expected results
After unlocking the screen, the resume event should be thrown (as happens with iphone).
Testcase
var win1 = Titanium.UI.createWindow({
backgroundColor:'white',
title:'Window1'
});
Ti.App.addEventListener('resume', function(event)
{
alert('resume')
});
win1.open();
1. Create a new mobile project
2. Paste the code in the app.js
3. Install this in an ipad 2 with iOS 4.x
4. Launch the app.
5. Lock the app using the right top hardware button.
6. Unlock it.
7. the alert should appear.
Mauro This is a behavioral change by Apple. Up untill iOS 4.X when the Sleep/Wake Button of iDevice is pressed while the app is in the foreground, it only resulted in the firing of pause event and when returning it would only fire the resumed event subsequently. Apple decided to change this since iOS 5.0 to actually make the app inactive and thus fire both pause and paused when the user hits the sleep/wake button while in foreground. There are many apple forums threads discussing this issue, but Apple seems to have made this intentionally to preserve the battery. Since this is a newly introduced activity in iOS 5.0 , there is nothing that we can do about it. I have made a [doc PR](https://github.com/appcelerator/titanium_mobile/pull/2868) to clearly show what events would be fired and its order.
Shak, Just tested with iPhone 4.3,iPad4.3, iPhone 5.0 , iPad 5.1 The ***change*** was **not** device specific, it was between iOS 4.X and 5.0 In iOS 4.X (iphone/iPad) sleep/wake button fires - pause while going to background and resumed when waking up. In iOS 5.0+ (iphone/iPad) sleep/wake button fires- pause followed by paused before becoming inactive and fires resume followed by resumed when waking up.
Closing this ticket as it is not our bug.