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

[Android] Continues functions after Ti.App._restart()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Android
      7.1.0 & 7.5.0
      run-on-main-thread = false
      bluetooth connecting/disconnecting

    • Story Points:
      5
    • Sprint:
      2019 Sprint 11

      Description

      Build this app onto an android device. Connect a bluetooth keyboard. Open the app. Press the blue button a few times. Disconnect the scanner while the app is counting. The app resets and picks back up where it left off.

      This is a problem because if I am running sql queries while the app resets it can continue to run the backbone functions without variables/Globals defined yet resulting in red screens.

      I am restarting the app. Why are variables still defined? Why are functions still running?

      In this app some variables are keeping their values, but in a larger scale app not all variables are redefined on Resume.

      I have added a testString variable that is defined initially as 'not Clicked', but redefined as 'clicked' once the runQueries function runs. You can see this in the second set of logs. If you press Clear after a reset it outputs 'not Clicked' and if you press it before the restart it says 'clicked'.

      This makes it very difficult when using an app that has bluetooth devices connected since it is impossible to know which variables will be defined correctly after a bluetooth reset. Now if you could fix the app from restarting when a bluetooth scanner is connected that would be great, but I think that's just an android problem.

      Log:

      09-21 14:46:41.950: E/TiAPI(8748):  currentCount: 58/150
      09-21 14:46:42.017: E/TiAPI(8748):  currentCount: 59/150
      09-21 14:46:42.248: E/TiAPI(8748):  currentCount: 60/150
      09-21 14:46:42.292: E/TiAPI(8748):  currentCount: 61/150
      09-21 14:46:42.602: E/TiAPI(8748):  currentCount: 62/150
      09-21 14:46:42.602: E/TiAPI(8748):  currentCount: 63/150
      09-21 14:46:42.951: E/TiAPI(8748):  currentCount: 64/150
      09-21 14:46:43.017: E/TiAPI(8748):  currentCount: 65/150
      09-21 14:46:43.236: E/TiAPI(8748):  *-*-*-*-*-*-* PAUSE BY OS *-*-*-*-*-*-*
      09-21 14:46:43.246: E/TiAPI(8748):  *-*-*-*-*-*-* STOP BY OS *-*-*-*-*-*-*
      09-21 14:46:43.247: E/TiAPI(8748):  *-*-*-*-*-*-* DESTROY BY OS *-*-*-*-*-*-*
      09-21 14:46:43.247: E/TiAPI(8748):  Restart Start
      09-21 14:46:43.348: E/TiAPI(8748):  Restart End
      09-21 14:46:43.348: E/TiAPI(8748):  currentCount: 66/150
      09-21 14:46:43.348: E/TiAPI(8748):  currentCount: 67/150
      09-21 14:46:43.601: E/TiAPI(8748):  currentCount: 68/150
      09-21 14:46:43.601: E/TiAPI(8748):  currentCount: 69/150
      09-21 14:46:43.952: E/TiAPI(8748):  currentCount: 70/150
      09-21 14:46:44.017: E/TiAPI(8748):  currentCount: 71/150
      09-21 14:46:44.029: E/TiAPI(8748):  *-*-*-*-*-*-* WINDOW OPENED *-*-*-*-*-*-*
      09-21 14:46:44.029: I/TiAPI(8748):  OS_ANDROID
      09-21 14:46:44.033: I/TiAPI(8748):  END OS_ANDROID
      09-21 14:46:44.033: E/TiAPI(8748):  *-*-*-*-*-*-* START BY OS *-*-*-*-*-*-*
      09-21 14:46:44.041: E/TiAPI(8748):  *-*-*-*-*-*-* RESUME BY OS *-*-*-*-*-*-*
      09-21 14:46:44.185: I/TiAPI(8748):  ACS Login Results for environment `development`:
      09-21 14:46:44.185: I/TiAPI(8748):  [object Object]
      09-21 14:46:44.349: E/TiAPI(8748):  currentCount: 72/150
      09-21 14:46:44.349: E/TiAPI(8748):  currentCount: 73/150
      09-21 14:46:44.602: E/TiAPI(8748):  currentCount: 74/150
      09-21 14:46:44.602: E/TiAPI(8748):  currentCount: 75/150
      09-21 14:46:44.954: E/TiAPI(8748):  currentCount: 76/150
      09-21 14:46:45.018: E/TiAPI(8748):  currentCount: 77/150
      09-21 14:46:45.350: E/TiAPI(8748):  currentCount: 78/150
      09-21 14:46:45.350: E/TiAPI(8748):  currentCount: 79/150
      09-21 14:46:45.602: E/TiAPI(8748):  currentCount: 80/150
      

      another:

      09-21 14:58:55.394: I/TiAPI(11235):  count: 175
      09-21 14:58:55.471: E/TiAPI(11235):  currentCount: 129/175
      09-21 14:58:55.739: E/TiAPI(11235):  currentCount: 130/175
      09-21 14:58:55.773: E/TiAPI(11235):  currentCount: 131/175
      09-21 14:58:55.835: E/TiAPI(11235):  currentCount: 132/175
      09-21 14:58:55.900: E/TiAPI(11235):  *-*-*-*-*-*-* PAUSE BY OS *-*-*-*-*-*-*
      09-21 14:58:55.906: E/TiAPI(11235):  *-*-*-*-*-*-* STOP BY OS *-*-*-*-*-*-*
      09-21 14:58:55.909: E/TiAPI(11235):  *-*-*-*-*-*-* DESTROY BY OS *-*-*-*-*-*-*
      09-21 14:58:55.909: E/TiAPI(11235):  Restart Start
      09-21 14:58:56.007: E/TiAPI(11235):  Restart End
      09-21 14:58:56.134: E/TiAPI(11235):  currentCount: 133/175
      09-21 14:58:56.139: E/TiAPI(11235):  currentCount: 134/175
      09-21 14:58:56.609: E/TiAPI(11235):  currentCount: 135/175
      09-21 14:58:56.609: E/TiAPI(11235):  currentCount: 136/175
      09-21 14:58:56.739: E/TiAPI(11235):  currentCount: 137/175
      09-21 14:58:56.778: E/TiAPI(11235):  currentCount: 138/175
      09-21 14:58:56.786: E/TiAPI(11235):  *-*-*-*-*-*-* WINDOW OPENED *-*-*-*-*-*-*
      09-21 14:58:56.786: I/TiAPI(11235):  OS_ANDROID
      09-21 14:58:56.790: I/TiAPI(11235):  END OS_ANDROID
      09-21 14:58:56.791: E/TiAPI(11235):  *-*-*-*-*-*-* START BY OS *-*-*-*-*-*-*
      09-21 14:58:56.796: E/TiAPI(11235):  *-*-*-*-*-*-* RESUME BY OS *-*-*-*-*-*-*
      09-21 14:58:56.835: E/TiAPI(11235):  currentCount: 139/175
      09-21 14:58:57.097: I/TiAPI(11235):  ACS Login Results for environment `development`:
      09-21 14:58:57.097: I/TiAPI(11235):  [object Object]
      09-21 14:58:57.135: E/TiAPI(11235):  currentCount: 140/175
      09-21 14:58:57.140: E/TiAPI(11235):  currentCount: 141/175
      09-21 14:58:57.609: E/TiAPI(11235):  currentCount: 142/175
      09-21 14:58:57.609: E/TiAPI(11235):  currentCount: 143/175
      09-21 14:58:57.740: E/TiAPI(11235):  currentCount: 144/175
      09-21 14:58:57.777: E/TiAPI(11235):  currentCount: 145/175
      09-21 14:58:57.836: E/TiAPI(11235):  currentCount: 146/175
      09-21 14:58:58.134: E/TiAPI(11235):  currentCount: 147/175
      09-21 14:58:58.141: E/TiAPI(11235):  currentCount: 148/175
      09-21 14:58:58.610: E/TiAPI(11235):  currentCount: 149/175
      09-21 14:58:58.610: E/TiAPI(11235):  currentCount: 150/175
      09-21 14:58:58.740: E/TiAPI(11235):  currentCount: 151/175
      09-21 14:58:58.778: E/TiAPI(11235):  currentCount: 152/175
      09-21 14:58:58.835: E/TiAPI(11235):  currentCount: 153/175
      09-21 14:58:59.134: E/TiAPI(11235):  currentCount: 154/175
      09-21 14:58:59.142: E/TiAPI(11235):  currentCount: 155/175
      09-21 14:58:59.612: E/TiAPI(11235):  currentCount: 156/175
      09-21 14:58:59.612: E/TiAPI(11235):  currentCount: 157/175
      09-21 14:58:59.741: E/TiAPI(11235):  currentCount: 158/175
      09-21 14:58:59.777: E/TiAPI(11235):  currentCount: 159/175
      09-21 14:58:59.836: E/TiAPI(11235):  currentCount: 160/175
      09-21 14:59:00.135: E/TiAPI(11235):  currentCount: 161/175
      09-21 14:59:00.141: E/TiAPI(11235):  currentCount: 162/175
      09-21 14:59:00.611: E/TiAPI(11235):  currentCount: 163/175
      09-21 14:59:00.611: E/TiAPI(11235):  currentCount: 164/175
      09-21 14:59:00.741: E/TiAPI(11235):  currentCount: 165/175
      09-21 14:59:00.778: E/TiAPI(11235):  currentCount: 166/175
      09-21 14:59:00.835: E/TiAPI(11235):  currentCount: 167/175
      09-21 14:59:01.135: E/TiAPI(11235):  currentCount: 168/175
      09-21 14:59:01.142: E/TiAPI(11235):  currentCount: 169/175
      09-21 14:59:01.613: E/TiAPI(11235):  currentCount: 170/175
      09-21 14:59:01.613: E/TiAPI(11235):  currentCount: 171/175
      09-21 14:59:01.743: E/TiAPI(11235):  currentCount: 172/175
      09-21 14:59:01.777: E/TiAPI(11235):  currentCount: 173/175
      09-21 14:59:01.836: E/TiAPI(11235):  currentCount: 174/175
      09-21 14:59:02.137: E/TiAPI(11235):  currentCount: 175/175
      09-21 14:59:04.849: I/TiAPI(11235):  testString: not Clicked
      

        Attachments

        1. alloy.js
          2 kB
        2. app.tss
          0.8 kB
        3. index.js
          3 kB
        4. index.tss
          0.2 kB
        5. index.xml
          0.4 kB
        6. tiapp.xml
          4 kB

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                josh.mocek josh.mocek
              • Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code