Skip to content

ep-002 crashes on android. TestWindow.js line 3 and line 15.  #17

@aokolovskis

Description

@aokolovskis

Hi, the demo crashes, because there is an error

line 3 controller is not found. i quess it should be the navController.

line 15 TestWindow is not found... well to solve this you can give the declaration function a name like Like Window and constuct it, using new window.

exports.TestWindow = function Window(navController) {  //named function Window
    var win = Ti.UI.createWindow({
        title:'Window '+navController.windowStack.length, //used the param instead of global
        backgroundColor:'#fff',
        layout:'vertical'
    });

    var add = Ti.UI.createButton({
        title:'Add A New Window',
        height:'50dp',
        width:'200dp',
        top:'20dp'
    });
    add.addEventListener('click', function() {
        navController.open(new Window(navController));  //call named constructor
    });
.....

Now it works fine on Android and iOS.

Regards
Aleksejs Okolovskis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions