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

Android: ScrollableView crashed when setViews([])

    Details

    • Story Points:
      5
    • Sprint:
      2016 Sprint 07 SDK

      Description

      I cant clear views through setViews([])

      Error:

      [ERROR] :  TiApplication: (main) [7060,7060] Sending event: exception on thread: main msg:java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 3, found: 0 Pager id: ffffffff Pager class: class ti.modules.titanium.ui.widget.TiUIScrollableView$1 Problematic adapter: class ti.modules.titanium.ui.widget.TiUIScrollableView$ViewPagerAdapter; Titanium 5.2.1,2016/03/18 22:51,23e1c7d
       
      [ERROR] :  TiApplication: java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 3, found: 0 Pager id: ffffffff Pager class: class ti.modules.titanium.ui.widget.TiUIScrollableView$1 Problematic adapter: class ti.modules.titanium.ui.widget.TiUIScrollableView$ViewPagerAdapter
       
      [ERROR] :  TiApplication: at android.support.v4.view.ViewPager.populate(ViewPager.java:1000)
       
      [ERROR] :  TiApplication: at android.support.v4.view.ViewPager.populate(ViewPager.java:952)
       
      [ERROR] :  TiApplication: at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1474)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
       
      [ERROR] :  TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
       
      [ERROR] :  TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
       
      [ERROR] :  TiApplication: at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
       
      [ERROR] :  TiApplication: at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
       
      [ERROR] :  TiApplication: at android.support.v7.internal.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:124)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
       
      [ERROR] :  TiApplication: at android.support.v7.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:393)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
       
      [ERROR] :  TiApplication: at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
       
      [ERROR] :  TiApplication: at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4825)
       
      [ERROR] :  TiApplication: at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
       
      [ERROR] :  TiApplication: at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2176)
       
      [ERROR] :  TiApplication: at android.view.View.measure(View.java:15518)
       
      [ERROR] :  TiApplication: at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1874)
       
      [ERROR] :  TiApplication: at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1089)
       
      [ERROR] :  TiApplication: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1265)
       
      [ERROR] :  TiApplication: at android.view.ViewRootImpl.doTraversal(ViewR
       
      [ERROR] :  TiApplication: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4351)
       
      [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:5041)
       
      [ERROR] :  TiApplication: at java.lang.reflect.Method.invokeNative(Native Method)
       
      [ERROR] :  TiApplication: at java.lang.reflect.Method.invoke(Method.java:511)
       
      [ERROR] :  TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
       
      [ERROR] :  TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
      

      Test code:

      index.xml

      <Alloy>
      	<Window class="container">
      		<ScrollableView id="scrollableView">
      			<View><Label>1</Label></View>
      			<View><Label>2</Label></View>
      			<View><Label>3</Label></View>
      		</ScrollableView>
      		<View height="Ti.UI.SIZE" top="0" layout="vertical">
      		<Button onClick="doClear">Clear</Button>		
      		</View>
      	</Window>
      </Alloy>
      

      index.js

      function doClear(e) {
          $.scrollableView.setViews([]);
      }
       
      $.index.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                msamah Ashraf Abu (Inactive)
                Reporter:
                falko Andrey Tkachenko
                Reviewer:
                Ashraf Abu (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration