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

Android: Going back to the tabgroup with android back button crashes app with "java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object ti.modules.titanium.ui.TabGroupProxy.getProperty(java.lang.String)"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.0
    • Fix Version/s: Release 6.1.0
    • Component/s: Android
    • Labels:
    • Environment:
    • Story Points:
      3
    • Sprint:
      2017 Sprint 04 SDK

      Description

      This issue is probably due to TIMOB-24253.

      Steps to reproduce:

      1. Use the code below in your app.js.

      var win1 = Ti.UI.createWindow({
          backgroundColor: 'blue',
          title: 'Blue'
      });
       
      var lbl = Ti.UI.createLabel({text: 'I am a blue window.'});
       
      lbl.addEventListener('click', function(){
      	Ti.UI.createWindow().open();	
      });
       
      win1.add(lbl);
       
      var win2 = Ti.UI.createWindow({
          backgroundColor: 'red',
          title: 'Red'
      });
       
      win2.add(Ti.UI.createLabel({text: 'I am a red window.'}));
       
      var tab1 = Ti.UI.createTab({
          window: win1,
          title: 'Blue'
      }),
      tab2 = Ti.UI.createTab({
          window: win2,
          title: 'Red'
      }),
      tabGroup = Ti.UI.createTabGroup({
          tabs: [tab1, tab2]
      });
      tabGroup.open();
      

      2. Build for android device/emulator.
      3. After the app launches click on I am blue window label.
      4. A new window opens up.
      5. Hit the android back button to close the window to return to the tab group.

      Actual results:

      1. The app crashes with error:

      [ERROR] :  TiApplication: (main) [8300,8300] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.timob24253/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object ti.modules.titanium.ui.TabGroupProxy.getProperty(java.lang.String)' on a null object reference; Titanium 6.1.0,2017/01/31 13:23,undefined
      [ERROR] :  TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.timob24253/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object ti.modules.titanium.ui.TabGroupProxy.getProperty(java.lang.String)' on a null object reference
      [ERROR] :  TiApplication: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
      [ERROR] :  TiApplication: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
      [ERROR] :  TiApplication: 	at android.app.ActivityThread.-wrap11(ActivityThread.java)
      [ERROR] :  TiApplication: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
      [ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:102)
      [ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:148)
      [ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5417)
      [ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
      [ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      [ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
      [ERROR] :  TiApplication: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object ti.modules.titanium.ui.TabGroupProxy.getProperty(java.lang.String)' on a null object reference
      [ERROR] :  TiApplication: 	at ti.modules.titanium.ui.widget.tabgroup.TiUIActionBarTabGroup.addTab(TiUIActionBarTabGroup.java:338)
      [ERROR] :  TiApplication: 	at ti.modules.titanium.ui.TabGroupProxy.handlePostOpen(TabGroupProxy.java:396)
      [ERROR] :  TiApplication: 	at ti.modules.titanium.ui.TabGroupProxy.windowCreated(TabGroupProxy.java:371)
      [ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiActivityWindows.windowCreated(TiActivityWindows.java:33)
      [ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiBaseActivity.windowCreated(TiBaseActivity.java:559)
      [ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:673)
      [ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiActivity.onCreate(TiActivity.java:21)
      [ERROR] :  TiApplication: 	at android.app.Activity.performCreate(Activity.java:6251)
      [ERROR] :  TiApplication: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
      [ERROR] :  TiApplication: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
      [ERROR] :  TiApplication: 	... 9 more
      

      Expected results:

      1. We should be able to return to the tabgroup with out a crash.

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              lchoudhary Lokesh Choudhary
              Tester:
              Lee Morris (Inactive)
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code