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

Android : An empty scrollableview causes the app to crash

    Details

    • Sprint:
      2014 Sprint 09 Tooling, 2014 Sprint 10 SDK

      Description

      This is a regression. It works as expected with 3.2.2.GA
      Description:

      1. Create an classic app & use the code below in the app.js.

      var win = Ti.UI.createWindow({
      backgroundColor: 'white',
      title: "ScrollableView Test"
      });
       
      var sav = Ti.UI.createScrollableView();
       
      win.add(sav);
       
      win.open();
      

      3. Build that app for device/emulator.

      Actual Result:

      1. The app crashes & we get the following logs in console:

      [ERROR] :  TiApplication: (main) [335,335] Sending event: exception on thread: main msg:java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0; Titanium 3.2.3,2014/04/22 10:17,b958a70
      [ERROR] :  TiApplication: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
      [ERROR] :  TiApplication: 	at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
      [ERROR] :  TiApplication: 	at java.util.ArrayList.get(ArrayList.java:304)
      [ERROR] :  TiApplication: 	at ti.modules.titanium.ui.widget.TiUIScrollableView$2.onPageScrolled(TiUIScrollableView.java:192)
      [ERROR] :  TiApplication: 	at android.support.v4.view.ViewPager.onPageScrolled(ViewPager.java:1712)
      [ERROR] :  TiApplication: 	at android.support.v4.view.ViewPager.pageScrolled(ViewPager.java:1633)
      [ERROR] :  TiApplication: 	at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:581)
      [ERROR] :  TiApplication: 	at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1600)
      [ERROR] :  TiApplication: 	at android.view.View.layout(View.java:14482)
      [ERROR] :  TiApplication: 	at android.view.ViewGroup.layout(ViewGroup.java:4469)
      [ERROR] :  TiApplication: 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
      [ERROR] :  TiApplication: 	at android.view.View.layout(View.java:14482)
      [ERROR] :  TiApplication: 	at android.view.ViewGroup.layout(ViewGroup.java:4469)
      [ERROR] :  TiApplication: 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
      [ERROR] :  TiApplication: 	at android.view.View.layout(View.java:14482)
      [ERROR] :  TiApplication: 	at android.view.ViewGroup.layout(ViewGroup.java:4469)
      [ERROR] :  TiApplication: 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)
      [ERROR] :  TiApplication: 	at android.view.View.layout(View.java:14482)
      [ERROR] :  TiApplication: 	at android.view.ViewGroup.layout(ViewGroup.java:4469)
      [ERROR] :  TiApplication: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
      [ERROR] :  TiApplication: 	at android.view.View.layout(View.java:14482)
      [ERROR] :  TiApplication: 	at android.view.ViewGroup.layout(ViewGroup.java:4469)
      [ERROR] :  TiApplication: 	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1669)
      [ERROR] :  TiApplication: 	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1527)
      [ERROR] :  TiApplication: 	at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
      [ERROR] :  TiApplication: 	at android.view.View.layout(View.java:14482)
      [ERROR] :  TiApplication: 	at android.view.ViewGroup.layout(ViewGroup.java:4469)
      [ERROR] :  TiApplication: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
      [ERROR] :  TiApplication: 	at android.view.View.layout(View.java:14482)
      [ERROR] :  TiApplication: 	at android.view.ViewGroup.layout(ViewGroup.java:4469)
      [ERROR] :  TiApplication: 	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2147)
      [ERROR] :  TiApplication: 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1966)
      [ERROR] :  TiApplication: 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1179)
      [ERROR] :  TiApplication: 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4859)
      [ERROR] :  TiApplication: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
      [ERROR] :  TiApplication: 	at android.view.Choreographer.doCallbacks(Choreographer.java:562)
      [ERROR] :  TiApplication: 	at android.view.Choreographer.doFrame(Choreographer.java:532)
      [ERROR] :  TiApplication: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
      [ERROR] :  TiApplication: 	at android.os.Handler.handleCallback(Handler.java:725)
      [ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:92)
      [ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:137)
      [ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5328)
      [ERROR] :  TiApplication: 	at java.lang.reflect.Method.invokeNative(Native Method)
      [ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Method.java:511)
      [ERROR] :  TiApplication: 	at
      [ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
      [ERROR] :  TiApplication: 	at dalvik.system.NativeStart.main(Native Method)
      

      Expected Results:

      1. The app should not crash when an empty scrollable view is added.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                lchoudhary Lokesh Choudhary
                Reviewer:
                Vishal Duggal (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code