[AC-6662] Android: NullPointerException when listening for click events for TiScrollView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | android |
Reporter | martin |
Assignee | Abir Mukherjee |
Created | 2021-01-14T14:58:14.000+0000 |
Updated | 2021-01-14T14:58:14.000+0000 |
Description
The following example crashes the app with:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.titanium.proxy.TiViewProxy.hierarchyHasListener(java.lang.String)' on a null object reference
at ti.modules.titanium.ui.widget.TiUIScrollView$TiScrollViewLayout$1.onSingleTapConfirmed(TiUIScrollView.java:82)
at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:323)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
const win=Ti.UI.createWindow({
backgroundColor:'white'
});
const view=Ti.UI.createScrollView({
backgroundColor:'red'
});
view.addEventListener('click',()=>view.parent.remove(view));
win.add(view);
win.open();
Probably the fix in https://github.com/appcelerator/titanium_mobile/pull/8726 should be used also for TiScrollView.
No comments