Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1871] Android: WebView - Setting touchEnabled to false crashes webView after click

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2014-01-15T05:56:13.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, nullpointerexception, touchEnabled, webview
ReporterMartin Tietz
AssigneeRitu Agrawal
Created2014-01-14T13:02:17.000+0000
Updated2016-03-08T07:40:47.000+0000

Description

h2. Problem After clicking a webView on Android that has touchEnabled set to false, the app crashes and throws a NullPointerException. This error does not occur with Titanium 3.1.3.

Test case

var win = Ti.UI.createWindow();
var webView = Ti.UI.createWebView({
	url: 'http://www.google.com',
	touchEnabled: false
});
win.add(webView);
win.open();

Logs

[ERROR] TiApplication: (main) [13523,45913] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.2.0,2013/12/20 10:57,d9182d6
[ERROR] TiApplication: java.lang.NullPointerException
[ERROR] TiApplication: 	at ti.modules.titanium.ui.widget.webview.TiUIWebView$TiWebView.onTouchEvent(TiUIWebView.java:112)
[ERROR] TiApplication: 	at android.view.View.dispatchTouchEvent(View.java:7384)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2203)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1938)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1910)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1910)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1910)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1910)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
[ERROR] TiApplication: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1910)
[ERROR] TiApplication: 	at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1966)
[ERROR] TiApplication: 	at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418)
[ERROR] TiApplication: 	at android.app.Activity.dispatchTouchEvent(Activity.java:2424)
[ERROR] TiApplication: 	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1914)
[ERROR] TiApplication: 	at android.view.View.dispatchPointerEvent(View.java:7564)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
[ERROR] TiApplication: 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419)
[ERROR] TiApplication: 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399)
[ERROR] TiApplication: 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370)
[ERROR] TiApplication: 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493)
[ERROR] TiApplication: 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182)
[ERROR] TiApplication: 	at android.os.MessageQueue.nativePollOnce(Native Method)
[ERROR] TiApplication: 	at android.os.Looper.loop(Looper.java:124)
[ERROR] TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5103)
[ERROR] TiApplication: 	at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] TiApplication: 	at java.lang.reflect.Method.invoke(Method.java:525)
[ERROR] TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
[ERROR] TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
[ERROR] TiApplication: 	at dalvik.system.NativeStart.main(Native Method)

Comments

  1. Ritu Agrawal 2014-01-15

    Thanks for reporting this issue. This issue is already covered by TIMOB-16063 and have been fixed. You can work around this issue for now by using a boolean value in a string i.e. "false". Note that this issue is limited to touchEnabled property.

JSON Source