Closed riveraser closed 7 years ago
The widget should wrap the ListView, not be a child of it. Please follow the steps in the readme:
Widget is the main element and the listview is inside the widget as you can see in the code I pasted..
Maybe you saw the Infiniti Scroller widget inside the list view....
Sorry, indeed.
I've never seen this error before. It seems to be related to the setRefreshing
code:
https://github.com/FokkeZB/nl.fokkezb.pullToRefresh/blob/master/nl.fokkezb.pullToRefresh/controllers/widget.js#L79-L93
Could you play a little with different devices/emulators, leaving out init functions etc to see if you can narrow down perhaps?
Full log here:
[WARN] : W/System.err: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. [WARN] : W/System.err: at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6024) [WARN] : W/System.err: at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:853) [WARN] : W/System.err: at android.view.ViewGroup.invalidateChild(ViewGroup.java:4320) [WARN] : W/System.err: at android.view.View.invalidate(View.java:10935) [WARN] : W/System.err: at android.view.View.invalidateParentIfNeeded(View.java:11021) [WARN] : W/System.err: at android.view.View.clearAnimation(View.java:16804) [WARN] : W/System.err: at android.support.v4.widget.SwipeRefreshLayout.startScaleDownAnimation(SwipeRefreshLayout.java:434) [WARN] : W/System.err: at android.support.v4.widget.SwipeRefreshLayout.setRefreshing(SwipeRefreshLayout.java:420) [WARN] : W/System.err: at android.support.v4.widget.SwipeRefreshLayout.setRefreshing(SwipeRefreshLayout.java:373) [WARN] : W/System.err: at com.rkam.swiperefreshlayout.SwipeRefresh.setRefreshing(SwipeRefresh.java:78) [WARN] : W/System.err: at com.rkam.swiperefreshlayout.SwipeRefreshProxy.setRefreshing(SwipeRefreshProxy.java:26) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [WARN] : W/System.err: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:136) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118) [ERROR] : TiExceptionHandler: (main) [25066,128741] ----- Titanium Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main) [0,128741] - In undefined:25,24 [ERROR] : TiExceptionHandler: (main) [0,128741] - Message: Uncaught Error: Only the original thread that created a view hierarchy can touch its views. [ERROR] : TiExceptionHandler: (main) [0,128741] - Source: refreshControl.setRefreshing(false); [ERROR] : V8Exception: Exception occurred at undefined:25: Uncaught Error: Only the original thread that created a view hierarchy can touch its views. [WARN] : EGL_genymotion: eglSurfaceAttrib not implemented
It looks like an error in the module. Could you try without the widget (following the instructions of the module) and report it there?
@riveraser have you tried @FokkeZB's comment?
The error occurs in widget.js:
refreshControl.setRefreshing(false);
Commenting this line out no longer causes the error, however, the loading indicator is never dimissed
That seems like a module issue then. It could also depend on the module for you are using. I originally made it to work with https://github.com/iskugor/Ti.SwipeRefreshLayout#set-refreshing but some people also use e.g. http://gitt.io/component/com.rkam.swiperefreshlayout.
Please play around with these module forks and report the bug at the relevant repo if neither of them work.
Fixed it, the issue was related to the UI-thread.
Hi there, I got this issue when trying on my phone... I use Titanium SDK 5.2.0 /// Funny thing is that this works perfectly on my emulators..
This is my code: