Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16246] Android: Android handles Ti.App events synchronously but iOS does not

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, event, sync
ReporterOnoma Epitheto
AssigneeUnknown
Created2014-01-16T16:02:12.000+0000
Updated2018-02-28T20:03:32.000+0000

Description

I noticed on android that when you fire a Ti.App event, titanium first executes the handler of the event and then it goes on with the flow after the firing of the event. This makes not sense and is not in parity with iOS. simple example demonstration:
Ti.App.addEventListener("test", function( e ) {
	console.log("test event received");
});

var win = Ti.UI.createWindow({
	backgroundColor:"white",
	navBarHidden:true
});

Ti.App.fireEvent("test", {});
console.log("test event fired");
win.open();

Result:

test event received test event fired

Expected result:

test event fired test event received

Comments

  1. Ritu Agrawal 2014-01-20

    Moving this ticket to engineering as I can reproduce the issue with the provided test case. iOS --- We get the same output as below irrespective of the ordering of following statements. Ti.App.fireEvent("test", {}); console.log("test event fired"); [INFO] : test event fired [INFO] : test event received Android -------- We get different output as below depending on the ordering of following statements. Ti.App.fireEvent("test", {}); console.log("test event fired"); [INFO] : test event received [INFO] : test event fired console.log("test event fired"); Ti.App.fireEvent("test", {}); [INFO] : test event fired [INFO] : test event received
  2. jithinpv 2014-09-04

    Issue reproduces Titanium SDK version 3.4.0 master, 3.2.0.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4 iOS simulator : iPhone Retina (3.5-inch), iOS 7.0.3

JSON Source