facebook

Please, how to handle closing the applications : CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #342677 Reply

    I need solution like if i leaving application some action is triggered.
    my game is based on some .mobi files with dynamic content, transition between pages through phoneui.gotoPage.
    and when i leave some of page (pressing home button or something), let’s call it “#m1-somepage”, the program must do something.

    im trying bind pagehide like:

    $(‘#m1-somepage’).bind(‘pagehide’, audio_stop());

    but it always fires before page hides (on page load), tried everything like pageshow, pagebeforehide etc….
    i dont understand why it fires BEFORE #m1-somepage loaded. and im stucked. is there any reliable solution how can we handle closing of application or just changing page (like returning in main menu)

    #342686 Reply

    support-michael
    Keymaster

    >I need solution like if i leaving application some action is triggered.

    What about using listening for cordova pause and resume events?

    >’pagehide’,…

    This is not a MobiOne phoneui.js event. It looks like jquery mobile or some other framework. Can you clarify by sharing more details? Are you mashing up jquery mobile widgets into a MobiOne app or something like that?

    #342705 Reply

    thanks Wayne! thank you, i would buy you a bunch of budweiser if i be there

    document.addEventListener(“deviceready”, onDeviceReady, false);

    function onDeviceReady(){
    document.addEventListener(“backbutton”, back_butt_pressed, false); // handle back button
    document.addEventListener(“pause”, audio_pause, false); // pause music when app goes to background (“pause”)
    document.addEventListener(“resume”, audio_resume, false); // resume music when we return to app from background
    }

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Please, how to handle closing the applications : CLOSED

You must be logged in to post in the forum log in