Results 1 to 15 of 15
  1. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #1  
    When ever my app is open, email wont load, facebook wont load, the second i close it they load, what is the best way to pause an app when it is open.

    My app is just a simple calculator app.

    Please help
  2. #2  
    an app is either open or close,,dont think there is a between state. I could be wrong.
  3. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #3  
    well when its minimized it slows down facebook and email from opening, usually completely stops facebook from loading
  4. #4  
    Quote Originally Posted by rothoof View Post
    well when its minimized it slows down facebook and email from opening, usually completely stops facebook from loading
    Sounds like you've got a memory leak or something.

    Are you using C/C++ or JavaScript?

    If JavaScript, post your setup(), activate(), and deactivate() methods here.
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup
  5. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #5  
    I am using javascript
    My brother noticed something interesting, when the text box is not highlighted, everything opens fine.

    If there is only one scene do i need deactivate()

    FirstAssistant.prototype.activate = function(event) {
    this.handleUpdate = this.handleUpdate.bind(this);

    Mojo.Event.listen(this.controller.get("thickness"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("depth"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("length"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("quantity"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("cost"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("board"), Mojo.Event.propertyChange, this.handleUpdate);


    };
    /* put in event handlers here that should only be in effect when this scene is active. For
    example, key handlers that are observing the document */
    };

    FirstAssistant.prototype.deactivate = function(event) {
    /* remove any event handlers you added in activate and do any other cleanup that should happen before
    this scene is popped or another scene is pushed on top */
    };

    FirstAssistant.prototype.cleanup = function(event) {
    Mojo.Event.stopListening(this.controller.get("thickness"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("depth"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("length"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("quantity"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("cost"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("board"), Mojo.Event.propertyChange, this.handleUpdate);

    /* this function should do any cleanup needed before the scene is destroyed as
    a result of being popped off the scene stack */
    };
  6. #6  
    Quote Originally Posted by rothoof View Post
    I am using javascript
    My brother noticed something interesting, when the text box is not highlighted, everything opens fine.

    If there is only one scene do i need deactivate()

    FirstAssistant.prototype.activate = function(event) {
    this.handleUpdate = this.handleUpdate.bind(this);

    Mojo.Event.listen(this.controller.get("thickness"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("depth"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("length"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("quantity"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("cost"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.listen(this.controller.get("board"), Mojo.Event.propertyChange, this.handleUpdate);


    };
    /* put in event handlers here that should only be in effect when this scene is active. For
    example, key handlers that are observing the document */
    };

    FirstAssistant.prototype.deactivate = function(event) {
    /* remove any event handlers you added in activate and do any other cleanup that should happen before
    this scene is popped or another scene is pushed on top */
    };

    FirstAssistant.prototype.cleanup = function(event) {
    Mojo.Event.stopListening(this.controller.get("thickness"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("depth"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("length"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("quantity"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("cost"), Mojo.Event.propertyChange, this.handleUpdate);

    Mojo.Event.stopListening(this.controller.get("board"), Mojo.Event.propertyChange, this.handleUpdate);

    /* this function should do any cleanup needed before the scene is destroyed as
    a result of being popped off the scene stack */
    };
    Put the code from your cleanup() function in activate().

    What is happening is every time your app gets activated again (and IIRC this is every time it gets screen focus, i.e. you minimize and remaximize it) it is listening for all events again.
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup
  7. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #7  
    ok i think that worked i also put the same code in deactivate() which seemed to help more, did I mention anytime the text boxes arent highlighted everything opens up fine
  8. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #8  
    OK its much better now, Thank you
  9. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #9  
    actually its hit and miss. sometimes they open, sometimes not. is there a way to unhighlight all text boxes when the app is minimized
  10. #10  
    Try just putting all your listeners in the setup method. That way they'll definitely only be added once.
  11. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #11  
    if i have any auto update features would that need to be in deactivate to?
  12. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #12  
    Im still not sure what i'm doing wrong anybody up for helping me for 10 bucks??

    I posted a youtube video that shows facebook and email not opening until I tap out of the textboxes. Sure this isn't a major app of any sort but i would still like to get an update out for my app before I get a bad review. Thanks for the help. What would you need to look at to help me out i'll pm you some code if need be.
    thanks for helping a newb.
    YouTube - rbrown530's Channel
  13. #13  
    Quote Originally Posted by rothoof View Post
    Im still not sure what i'm doing wrong anybody up for helping me for 10 bucks??

    I posted a youtube video that shows facebook and email not opening until I tap out of the textboxes. Sure this isn't a major app of any sort but i would still like to get an update out for my app before I get a bad review. Thanks for the help. What would you need to look at to help me out i'll pm you some code if need be.
    thanks for helping a newb.
    YouTube - rbrown530's Channel
    No need to pay me, just send me the code and I'll take a look at it to see if I may be able to find the problem.
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup
  14. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #14  
    Ok thanks, I pm'd you
  15. rothoof's Avatar
    Posts
    510 Posts
    Global Posts
    514 Global Posts
       #15  
    let me know if you need the .html file

Posting Permissions