- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The function resume and pause functions don't work properly on my tablet Dragon Touch Y88. This device can't resume my game ,everywhen I pause the game, went to the menu screen of the tablet, then went back to the game, the game always restart. It work fine on my other devices ( Samsung S3, HTC one, ... ). Other games can pause and resume, but my game is using Construct 2 with Intel XDK , these functions didn't work on this tablet. Please help to fix this ! Thank you.
Code:
document.addEventListener("pause", function() { cr_setSuspended(true); }, false); document.addEventListener("resume", function() { cr_setSuspended(false); }, false);
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My suspicion is that the device has low memory and the Android OS is closing the app after pause (or the "Don't keep activities" option might be turned on in the "Developer Options" of the problem device.
If the app is closed it will result in a restart.
Can you confirm that you are or are not getting the pause and resume functions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank your help , Paul ^ ^.
If i pressed the button to minimize ( pause ) on the menu navigator ( bottom black bar on Android tablet with some buttons ), then I get back to the game right the way, the game can resume at that moment. If i paused the game then go to the main screen of this tablet and work on other apps or do something outside my game, then I got back to the game, the game is closed and restarted.
P/S : Other games on this tablet work perfect without problem of this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you confirm whether or not you are seeing the pause and resume events?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry Paul, i don't get you >.< Where can I see the pause and resume events ? In my code or somewhere ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Leo. According to the code snippet you provided in a prior post you've got a function that is being called whenever you receive either a pause or resume event. You could add some console.log() messages in there to see if the events are happening. You'll have to be watching the console to see these messages (and I'm assuming the console will still be alive when these happen, so this might get tricky). But the simplest thing to do might be something like this:
document.addEventListener("pause", function() { console.log("pause begin"); cr_setSuspended(true); console.log("pause end"); }, false); document.addEventListener("resume", function() { console.log("resume begin"); cr_setSuspended(false); console.log("resume end"); }, false);
And then set the "debuggable" equal to "true" in the additions.xml file, similar to this file: https://github.com/xmnboy/hello-cordova/blob/master/intelxdk.config.additions.xml.
Once you have the above, build the app (using Crosswalk) and install it on your test device. Use the USB and remote CDT to monitor the console from your app. See this article for some help: https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview#RemoteChromeDevTools
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page