×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    4

    Question Pause application when set to background and resume when set to foreground

    Hi, I've built a html app using the html5application template in Qt creator, however. It did not pass the QA cause the app is not paused when the app goes into the background and resumed when it goes to the foreground again. I guess the MeeGo multitasking is better than Nokia wants it to be...

    Is there a way to simply pause / resume the entire app and what events should I be listening for when app goes into background/foreground ? Thanks.

  2. #2
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Pause application when set to background and resume when set to foreground

    Hi

    implement in html5viewer detecting the application goes to background / foreground then handle the detection result appropriately in your app --- check this on how to communicate with JScript by using QWebFrame::evaluateJavaScript

    You cannot pause / resume the whole app.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    90

    Re: Pause application when set to background and resume when set to foreground

    You can't pause an app, but you can put it to idle... Here is an evenhandler as a member of the main window:

    bool MyAppMainWindow::eventFilter(QObject *obj, QEvent *event)
    {
    if (event->type() == QEvent::ApplicationDeactivate) {
    QThread *this_thread = QThread::currentThread();
    this_thread->setPriority(QThread::IdlePriority);
    return true; // The event is handled
    }
    if (event->type() == QEvent::ApplicationActivate) {
    QThread *this_thread = QThread::currentThread();
    this_thread->setPriority(QThread::NormalPriority);
    return true;
    }
    return QObject::eventFilter(obj, event);
    }

  4. #4
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Pause application when set to background and resume when set to foreground

    Hi

    So what is the point in change a thread priority? You need to pause the whole process. That won't work , i think. There is no other easy way as to handle go-to-background/foreground events in html code.

    That is definitely trouble in html use

    Implement the application exit when it goes on background --- maybe it will not affect users much.

    Regards,
    Igor

Similar Threads

  1. Play, Pause and Resume in Video Streaming.
    By somnathbanik in forum Symbian
    Replies: 1
    Last Post: 2011-02-04, 15:12
  2. pause/resume video midlet issue
    By raduc5a in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2008-08-31, 10:48
  3. Music player pause & resume
    By mobi1 in forum Symbian
    Replies: 8
    Last Post: 2007-09-19, 10:08
  4. How to pause and resume in CMMFDevSound
    By junhuali in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2007-05-14, 16:58
  5. Correctly pause and resume MIDlet?
    By Terol in forum Mobile Java General
    Replies: 2
    Last Post: 2002-08-05, 06:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •