Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4841] Android: globalPoint is null for touchstart events for window and view

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2011-08-26T11:52:19.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterJon Alter
AssigneeDon Thorp
Created2011-07-29T17:00:42.000+0000
Updated2017-03-22T20:33:14.000+0000

Description

globalPoint is null for touchstart events for windows or views Step 1: run the code below Step 2: tap the window Step 3: look at the error in the console
var win = Ti.UI.createWindow({
	backgroundColor: 'blue'
});
win.addEventListener('touchstart', function(e){

    Ti.API.info("Touch Started for view: " + e.source);
    Ti.API.info("View Center: " + e.source.center.x + "," + e.source.center.y);
    Ti.API.info("e.globalPoint: " + e.globalPoint);
    Ti.API.info("Start Touch: " + e.globalPoint.x + "," + e.globalPoint.y);
});
win.open();
W/InputManagerService(   84): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41a3c340
D/dalvikvm(   84): GC_CONCURRENT freed 1895K, 51% free 13619K/27655K, paused 7ms+11ms
I/TiAPI   (  602): (kroll$1: app://app.js) [27143,93021] Touch Started for view: [Ti.UI.Window]
I/TiAPI   (  602): (kroll$1: app://app.js) [14,93035] View Center: 640,363.5
I/TiAPI   (  602): (kroll$1: app://app.js) [4,93039] e.globalPoint: null
E/KrollCallback(  602): (kroll$1: app://app.js) [3,93042] ECMA Error evaluating source, invocation: [callMethod UI.Window.UI.Window:event:touchstart null], message: TypeError: Cannot read property "x" from null (file:///android_asset/Resources/app.js#9)
E/KrollCallback(  602): org.mozilla.javascript.EcmaError: TypeError: Cannot read property "x" from null (file:///android_asset/Resources/app.js#9)
E/KrollCallback(  602): 	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3784)
E/KrollCallback(  602): 	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3762)
E/KrollCallback(  602): 	at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3790)
E/KrollCallback(  602): 	at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3809)
E/KrollCallback(  602): 	at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3822)
E/KrollCallback(  602): 	at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1507)
E/KrollCallback(  602): 	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1398)
E/KrollCallback(  602): 	at script(file:///android_asset/Resources/app.js:9)
E/KrollCallback(  602): 	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
E/KrollCallback(  602): 	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
E/KrollCallback(  602): 	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
E/KrollCallback(  602): 	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
E/KrollCallback(  602): 	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
E/KrollCallback(  602): 	at org.appcelerator.titanium.kroll.KrollCallback.callSync(KrollCallback.java:139)
E/KrollCallback(  602): 	at org.appcelerator.titanium.kroll.KrollCallback$1.run(KrollCallback.java:164)
E/KrollCallback(  602): 	at android.os.Handler.handleCallback(Handler.java:587)
E/KrollCallback(  602): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/KrollCallback(  602): 	at android.os.Looper.loop(Looper.java:126)
E/KrollCallback(  602): 	at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
E/TiJSError(  602): (kroll$1: app://app.js) [16,93058] ----- Titanium Javascript Runtime Error -----
E/TiJSError(  602): (kroll$1: app://app.js) [3,93061] - In file:///android_asset/Resources/app.js:9,0
E/TiJSError(  602): (kroll$1: app://app.js) [1,93062] - Message: TypeError: Cannot read property "x" from null (file:///android_asset/Resources/app.js#9)
E/TiJSError(  602): (kroll$1: app://app.js) [3,93065] - Source: null
D/SntpClient(   84): request time failed: java.net.SocketException: Address family not supported by protocol
D/SntpClient(   84): request time failed: java.net.SocketException: Address family not supported by protocol

Associated Helpdesk Ticket

http://appc.me/c/APP-115761

Comments

  1. Reggie Seagraves 2011-08-26

    globalpoint is being deprecated. Please see linked item for customer solution.
  2. Lee Morris 2017-03-22

    Closing ticket as the issue will not fix and with reference to the above comments.

JSON Source