Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5383] Android: Window children property is never null unlike iOS

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-07-12T14:14:15.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sRelease 2.1.0
ComponentsAndroid
Labelsapi, module_window, parity, qe-testadded
ReporterRick Blalock
AssigneeNeeraj Gupta
Created2011-09-27T14:31:28.000+0000
Updated2014-07-04T07:13:21.000+0000

Description

Overview: The children property of a Ti.UI.window is never null on Android where iOS it can be. Explanation: var win = Ti.UI.createWindow(); On iOS win.children will be 'null'. On Android, it will not be null. An Android developer can check: `win.children[0]' to see if it's null. However this will throw an error in iOS since it's really null and not an array.

Comments

  1. Junaid Younus 2012-07-12

       var win = Ti.UI.createWindow({ backgroundColor: 'white' });
       
       Ti.API.info('win.children: ' + win.children[0]);
       
       win.open();
       
    Tested the code on the iOS simulator and on a Samsung Galaxy S2 with 2.1GA. Here is the console output for both devices: "win.children: undefined". Expected behavior, ticket closed.
  2. Shyam Bhadauria 2012-08-17

    Environment used for verification - Tested with Titanium SDK: 2.2.0.v20120816212512 Tested with Titanium  Studio: 2.1.1.201207271312 Device - Samsung GALAXY Note Android 2.3.6, iOS 5.1 simulator Machine OS - MAC 10.8

JSON Source