Topener / nl.fokkezb.pullToRefresh

Widget to implement a table pull-to-refresh header in Titanium Alloy
184 stars 60 forks source link

Android app crashes #43

Closed gildebrand closed 9 years ago

gildebrand commented 9 years ago

My android app that uses this pullToRefresh widget crashes after clicking around in the app a couple of times. This issue seems to originate from the com.rkam.swiperefreshlayout module, which is discussed here: https://github.com/raymondkam/Ti.SwipeRefreshLayout/issues/5

Ti version is 3.5.1. How can I solve this?

E/AndroidRuntime(21815): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
E/AndroidRuntime(21815):    at android.view.ViewGroup.addViewInner(ViewGroup.java:3759)
E/AndroidRuntime(21815):    at android.view.ViewGroup.addView(ViewGroup.java:3612)
E/AndroidRuntime(21815):    at android.view.ViewGroup.addView(ViewGroup.java:3557)
E/AndroidRuntime(21815):    at android.view.ViewGroup.addView(ViewGroup.java:3533)
E/AndroidRuntime(21815):    at com.rkam.swiperefreshlayout.SwipeRefresh.processProperties(SwipeRefresh.java:68)
E/AndroidRuntime(21815):    at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1209)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:500)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:507)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:491)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:469)
E/AndroidRuntime(21815):    at ti.modules.titanium.ui.widget.TiUIScrollableView$ViewPagerAdapter.instantiateItem(TiUIScrollableView.java:516)
E/AndroidRuntime(21815):    at android.support.v4.view.PagerAdapter.instantiateItem(PagerAdapter.java:110)
E/AndroidRuntime(21815):    at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:832)
E/AndroidRuntime(21815):    at android.support.v4.view.ViewPager.populate(ViewPager.java:982)
E/AndroidRuntime(21815):    at android.support.v4.view.ViewPager.populate(ViewPager.java:914)
E/AndroidRuntime(21815):    at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1451)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.constrainChild(TiCompositeLayout.java:398)
E/AndroidRuntime(21815):    at org.appcelerator.titanium.view.TiCompositeLayout.onMeasure(TiCompositeLayout.java:278)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5352)
E/AndroidRuntime(21815):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
E/AndroidRuntime(21815):    at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5352)
E/AndroidRuntime(21815):    at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
E/AndroidRuntime(21815):    at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2533)
E/AndroidRuntime(21815):    at android.view.View.measure(View.java:17387)
E/AndroidRuntime(21815):    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2213)
E/AndroidRuntime(21815):    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1352)
E/AndroidRuntime(21815):    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1549)
E/AndroidRuntime(21815):    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1236)
E/AndroidRuntime(21815):    at an
W/ActivityManager(  819):   Force finishing activity nu.kodfabriken.ourapp/org.appcelerator.titanium.TiActivity
FokkeZB commented 9 years ago

If it originates from that module, what makes you think this widget is playing a role in it?

tlenclos commented 9 years ago

Got the same error, is this related to https://github.com/iskugor/Ti.SwipeRefreshLayout/issues/9 ?

FokkeZB commented 9 years ago

Looks like it is. Please continue at the module repo, closing this.