onHide() not firing?

Former Member
Former Member
Hi,

This is my first post, so please be gentle! And I only started with Connect IQ on Saturday, so I'm still at the low end of the learning curve ;)

I've built a widget that fires a WebRequest (all fine there). A View encapsulates the web request and reports progress/results, but it can be dismissed during/after the request with any key. I'm using an InputBehaviour to capture the key press, cancel any outstanding Web Requests and then pop the View from the stack. However... the view's onHide() method isn't firing when it gets popped - is that the expected behaviour?

The issue I have is that I also have a timer in the view, and my onHide() method is supposed to clean up the timer. As this doesn't happen, I'm building up a number of timers over subsequent requests and, eventually, the Simulator kills the Widget with a "Too Many Timers" exception.

I'm running in the simulator, using the Forerunner 235 model...

What am I missing?
Thanks,
Oliver
  • Can you post your code here? That might make it clearer. I'm not sure what you're doing in onHide() - just stopping the timer or stopping and freeing it, or where you create and start the timer. If I have a timer in the view, I generally start it in initialize(), and it gets cleaned up/stopped when the widget exits, so there's never more than one, and it runs the whole time. (even if I'm displaying a menu, etc)
  • Former Member
    Former Member over 8 years ago
    I'm going to withdrawn my post which an embarrassed blush... I think my issue was that I had moved my project in the filesystem - and was editing one version, while testing against another...
    My excuse is it was getting late last night...

    Sorry!!

    onHide() does indeed work as I was expecting!