简体   繁体   English

Android Tableview在Titan Appcelerator SDK 7.5.0上崩溃

[英]Android tableview crashing on titanium Appcelerator SDK 7.5.0

I am getting the following error only on Android when I click on table view which has a custom table row. 当我单击具有自定义表格行的表格视图时,仅在Android上出现以下错误。 Can someone please help me understand this? 有人可以帮我理解吗?

TiExceptionHandler: (main) [5645,45992] Attempt to invoke virtual met hod 'void org.appcelerator.titanium.view.TiUIView.registerForTouch()' on a null object reference [ERROR] : TiExceptionHandler: [ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.h andleGetView(TiViewProxy.java:594) [ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.h andleMessage(TiViewProxy.java:270) [ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.ja va:102) [ERROR] : TiExceptionHandler: android.os.Looper.loop(Looper.java:193) [ERROR] : TiExceptionHandler: android.app.ActivityThread.main(ActivityThrea d.java:6669) [ERROR] : TiExceptionHandler: java.lang.reflect.Method.invoke(Native Method ) [ERROR] : TiExceptionHandler: com.android.internal.os.RuntimeInit$MethodAnd ArgsCaller.run(RuntimeInit.java:493) [ERROR] : TiExceptionHandler: com.android.internal.os.ZygoteInit.main(Zygot eInit.java:858) TiExceptionHandler:(主)[5645,45992]尝试在空对象引用[ERROR]上调用虚拟方法'void org.appcelerator.titanium.view.TiUIView.registerForTouch()':TiExceptionHandler:[ERROR]:TiExceptionHandler:org .appcelerator.titanium.proxy.TiViewProxy.h andleGetView(TiViewProxy.java:594)[ERROR]:TiExceptionHandler:org.appcelerator.titanium.proxy.TiViewProxy.h andleMessage(TiViewProxy.java:270)[ERROR]:TiExceptionHandler:android .os.Handler.dispatchMessage(Handler.ja va:102)[ERROR]:TiExceptionHandler:android.os.Looper.loop(Looper.java:193)[ERROR]:TiExceptionHandler:android.app.ActivityThread.main(ActivityThrea d .java:6669)[ERROR]:TiExceptionHandler:java.lang.reflect.Method.invoke(本机方法)[ERROR]:TiExceptionHandler:com.android.internal.os.RuntimeInit $ MethodAnd ArgsCaller.run(RuntimeInit.java:493 )[错误]:TiExceptionHandler:com.android.internal.os.ZygoteInit.main(Zygot eInit.java:858)

OK i just removed the console.log(JSON.stringify(e)); 好吧,我刚刚删除了console.log(JSON.stringify(e)); in code and it worked. 在代码,它的工作。

UI View and UITableView are Classes that belongs to Apple iOS SDK, so those objects can never be Instantiated with Android, I am impress that Titanium didn't detect the wrong compatibility. UI View和UITableView是属于Apple iOS SDK的类,因此这些对象永远无法使用Android实例化,我印象深刻的是Titanium没有检测到错误的兼容性。

In android you should use ListView or RecyclerView, the most similar name object that Android contains is TableLayout but is barely used. 在android中,您应该使用ListView或RecyclerView,Android包含的最相似名称对象是TableLayout,但很少使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM