Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-4061

Android: setInterval does not run on first app launch

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: Release 1.6.2
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
    • Environment:

      TiSDK 1.6.2, Android Simulator 2.3

      Description

      If the function passed into setInterval will not run the first time you run the app. If you exit the app and relaunch, the function will begin to execute.

      Step 1: run the code below
      Step 2: notice the lack of output in the log
      Step 3: close the app
      Step 4: relaunch the app
      Step 5: see the output in the log

      var win = Ti.UI.createWindow({
      	backgroundColor:'blue',
      	fullscreen: true
      });
       
      win.open();
       
      var myfun = function() {
          Ti.API.info('timer fired!');
      };
       
      win.addEventListener('open', function(e){
      	setInterval(myfun, 2000);
      });

        Attachments

          Activity

            People

            • Assignee:
              dthorp Don Thorp
              Reporter:
              jalter Jon Alter
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-3489
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration