How do I track and process when my application is minimized?

0 favourites
  • 1 posts
  • I need it when the application is minimized, so that it becomes inactive and my image is displayed in it.

    Hiding let it be just a display of my picture.

    I did this:

    I did this:

    The code itself is executed:

    var global = Function('return this')();
    window.onblur = function() {
    window.onfocus = function() {

    This method works only in the browser. And I need something to work on Android devices.

    I came up with this method:

    When exporting to Cordova, there will be an Index.html file.

    There I write in Script tags

     document.addEventListener("deviceready", function () 
     window["c2iscordova"] = true; 
     // Create new runtime using the c2canvas 
     document.addEventListener("pause", function() { 
     }, false); 
     document.addEventListener("resume", function() { 
     }, false); 
     }, false); 

    This allows me to catch when this application is in focus or not. But not 100% of the time. Sometimes it just does not work out. But when the screen splits into 2, it works out in 100% of cases.

    In the project settings, I turned pause on focus on and off.

    The same events Plugin Browser.

    - on supended and on resumed checked also give 0% processing.

    Handling keys on menu button and on search button also do not give any result.

    How to do what I could handle when the application is minimized - so that the picture would change as in Google Chrome in incognito mode.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)