0

I don't really know where to start as this problem is hard to reproduce and debug. I have recently developed a Widget for showing stats regarding cryptocurrencies on Samsung Gear devices, called CryptoWidget.

Everything works as it is supposed to. However, when the widget hasn't been active for a while, e.g. you switched to the clock-face or screen is switched off for some time, the widget becomes unresponsive. All event-handlers that are registred in the window.onLoad function seem to be removed. However, as soon as you switch to the next widget and then back again it starks working again.

I am including the script files in the html header and register my handlers like this

(function() {
    window.onload = function() {
        document.getElementById("someDiv").addEventListener('click', someFunction);
        //...

I know this is very little information and I will happily provide more. Unfortunately, I have no idea what the reason for this could be. The Tizen documentation is, as usual, not really helpful. The problem is not reproducible in the emulator, only on actual devices. And even there, the log-dump does not give away if there were errors or anything else. It seems the whole onload function does not get executed.

Thanks for any ideas!

Henry
  • 727
  • 1
  • 6
  • 25
  • Which events are you listening ? share the names please – Iqbal hossain Dec 18 '17 at 08:48
  • There are four 'click' and one 'visibilitychange' handlers. The click handlers get registred first and there is no other code besides registring listeners that could fail the method – Henry Dec 18 '17 at 09:22
  • I have checked click listener and sensor data listener .... both are working fine even after the screen went background and come back If you update your question with actual code it will be more easy to identify the problem i think – Iqbal hossain Dec 19 '17 at 05:09
  • Well, the problem only persists when the screen has been inactive for a longer period of time. As I said it is hard to reproduce. As for the code: it really only consists out of multiple addEventListener statements whose methods are not executed since the listeners are not triggered.. – Henry Dec 19 '17 at 09:02
  • Long period means? how much time ? – Iqbal hossain Dec 19 '17 at 10:21
  • Sometimes after 5 minutes. Almost guaranteed after a couple of hours. The strange thing is it starts working again if you switch to the next widget and then back again. Therefore, a code-failure can hardly be the reason - it has to be connected to idling somehow – Henry Dec 19 '17 at 11:26

0 Answers0