You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Kaupo Kuresson (JIRA)" <ji...@apache.org> on 2014/04/21 17:06:14 UTC
[jira] [Created] (CB-6480) Resume event is sometimes not fired when
system time is changed
Kaupo Kuresson created CB-6480:
----------------------------------
Summary: Resume event is sometimes not fired when system time is changed
Key: CB-6480
URL: https://issues.apache.org/jira/browse/CB-6480
Project: Apache Cordova
Issue Type: Bug
Components: Android
Affects Versions: 3.4.0, 2.4.0
Environment: Android 4.1.2. Both real device (LG-P710) and emulator.
Reporter: Kaupo Kuresson
I managed to reproduce the bug in a simple 'HelloWorld' app:
1. cordova create hello com.example.hello HelloWorld
2. cordova platform add android
3. add listeners to "pause" and "resume" events:
{code:JavaScript}
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('pause', this.onPause, false);
document.addEventListener('resume', this.onResume, false);
},
onPause: function() {
console.log("PAUSED");
},
onResume: function() {
console.log("RESUMED");
},
};
{code}
Steps to reproduce the bug:
1. Launch the app
2. Go to "Date & time" settings. (Pause event works fine, prints "PAUSED")
3. Set system time to be some minutes in the past manually.
4. Resume app. (Resume event works fine, prints "RESUMED")
5. Go to "Date & time" settings again. (Pause event works fine, prints "PAUSED")
6. Check "Automatic date & time", so time is corrected.
7. Resume app. (Resume event is NOT fired at first. It is fired later, once the amount of minutes that you changed the time to the past has passed.)
Expected result would be that the resume event is fired immediately in the second case as well.
--
This message was sent by Atlassian JIRA
(v6.2#6252)