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

Android: launch activity no longer throws create & start lifecycle events as of 8.0.1

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 8.0.1
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Description

      For historical reasons, we had incorporated receiving the 'start' event from the launch activity into how our app unfolds.

      Let's look at a startup log for an app that just creates and opens a window.

      app.js:

      if (Ti.Platform.osname === 'android') {
          var launcher = Ti.Android.currentActivity;
          launcher.addEventListener('create', function(e) {
              Ti.API.info('+++ LAUNCHER onCreate');;
          });
          launcher.addEventListener('destroy', function(e) {
              Ti.API.info('+++ LAUNCHER onDestroy');
          });
          launcher.addEventListener('pause', function(e) {
              Ti.API.info('+++ LAUNCHER onPause');
          });
          launcher.addEventListener('resume', function(e) {
              Ti.API.info('+++ LAUNCHER onResume');
          });
          launcher.addEventListener('start', function(e) {
                  Ti.API.info('+++ LAUNCHER onStart: ');
       
          });
          launcher.addEventListener('stop', function(e) {
              Ti.API.info('+++ LAUNCHER onStop');
          });
       
          launcher.addEventListener('newintent', function(e) {
              Ti.API.info('+++ LAUNCHER onNewIntent: ' + JSON.stringify(e));
          });
      }
       
      var window = Ti.UI.createWindow({
          backgroundColor: 'white',
          layout: 'vertical'
      });
       
      window.open();
      

      The log looks like this for SDK 8.0.0.GA:

      – Start application log -----------------------------------------------------
      [INFO] : Project built successfully in 57s 612ms
      [ERROR] : Zygote: v2
      [INFO] : SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=com.phondini.test
      [INFO] : TiApplication: (main) [0,0] checkpoint, app created.
      [INFO] : MultiDex: VM with version 2.1.0 has multidex support
      [INFO] : MultiDex: Installing application
      [INFO] : MultiDex: VM has multidex support, MultiDex support library is disabled.
      [ERROR] : Zygote: accessInfo : 0
      [WARN] : SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0010, [-1 -1 -4 -1 0 1]
      [INFO] : TiApplication: (main) [110,110] Analytics have been disabled
      [INFO] : TiApplication: (main) [1761,1871] Titanium Javascript runtime: v8
      [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
      [WARN] : art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
      [INFO] : test 1.0 (Powered by Titanium 8.0.0.3726240fa2)
      [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.phondini.test.TestActivity@db057c6
      [INFO] : InputMethodManager: HSI ignore mServedView == null or mServedView.getWindowToken() != windowToken, mServedView :0
      [INFO] : +++ LAUNCHER onCreate
      [INFO] : +++ LAUNCHER onStart:

      [INFO] : +++ LAUNCHER onResume
      [ERROR] : E/ViewRootImpl@819222d[TestActivity]: ViewRootImpl #2 Surface is not valid.
      [INFO] : +++ LAUNCHER onPause
      [INFO] : OpenGLRenderer: Initialized EGL, version 1.4
      [INFO] : InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus
      [INFO] : +++ LAUNCHER onStop
      [INFO] : TiVerify: (Timer-0) [4995,4995] Verifying module licenses...
      [INFO] : I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
      [INFO] : I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
      [INFO] : TiVerify: (Timer-0) [372,5367] Successfully verified module licenses

      but with the SDK 8.0.1.GA, the log looks like this:

      – Start application log -----------------------------------------------------
      [INFO] : Project built successfully in 56s 798ms
      [ERROR] : Zygote: v2
      [INFO] : SELinux: SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=com.phondini.test
      [INFO] : TiApplication: (main) [0,0] checkpoint, app created.
      [INFO] : art: Background partial concurrent mark sweep GC freed 49185(3MB) AllocSpace objects, 14(1184KB) LOS objects, 39% free, 11MB/19MB, paused 7.077ms total 77.640ms
      [INFO] : MultiDex: VM with version 2.1.0 has multidex support
      [INFO] : MultiDex: Installing application
      [ERROR] : Zygote: accessInfo : 0
      [WARN] : SELinux: SELinux selinux_android_compute_policy_index : Policy Index[2], Con:u:r:zygote:s0 RAM:SEPF_SECMOBILE_7.0_0010, [-1 -1 -4 -1 0 1]
      [INFO] : MultiDex: VM has multidex support, MultiDex support library is disabled.
      [INFO] : TiApplication: (main) [213,213] Analytics have been disabled
      [INFO] : TiApplication: (main) [2051,2264] Titanium Javascript runtime: v8
      [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
      [WARN] : art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
      [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.phondini.test.TestActivity@db057c6
      [INFO] : test 1.0 (Powered by Titanium 8.0.1.c4f6f25c7d)
      [INFO] : InputMethodManager: HSI ignore mServedView == null or mServedView.getWindowToken() != windowToken, mServedView :0
      [INFO] : +++ LAUNCHER onResume
      [INFO] : +++ LAUNCHER onPause
      [INFO] : +++ LAUNCHER onStop
      [INFO] : OpenGLRenderer: Initialized EGL, version 1.4
      [INFO] : InputMethodManager: [IMM] startInputInner - mService.startInputOrWindowGainedFocus

      These events are missing starting with the 8.0.1.GA SDK.

      [INFO] : +++ LAUNCHER onCreate
      [INFO] : +++ LAUNCHER onStart:

      I don't know whether this was intentional or not, but it did take us a while to figure out what was going on in our code when our app behaved differently starting with 8.0.1.

      Anyway, not sure whether this is a bug or a documentation issue but felt it was important to point out that this is a change in behavior.

        Attachments

          Activity

            People

            • Assignee:
              ybanev Yordan Banev
              Reporter:
              jfalcone Joe Falcone
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                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