Project: titanium
Issue TIMOB-23134: Android: ScrollableView crashed when setViews([])
I cant clear views through setViews([]) Error: {code} [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) {code} Test code: index.xml {code:xml}	1	2	3	Clear	{code} index.js {code:javascript} function doClear(e) { $.scrollableView.setViews([]); } $.index.open(); {code}
Story points: 5