Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2838] Reopening a window opens it twice

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T03:30:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, scrollview
Reporterpete
AssigneeDon Thorp
Created2011-04-15T03:30:44.000+0000
Updated2017-03-09T23:18:23.000+0000

Description

When I click to reopen a window I get multiple instances of that window. Either it is being opened twice the 2nd time or never really closed. Please see the example code for a better explanation.

Titanium.UI.setBackgroundColor('#000');

var win1 = Titanium.UI.createWindow({

backgroundColor:'#000',
exitOnClose:true,
navBarHidden:true,
orientationModes: [Ti.UI.PORTRAIT],
zIndex:-1
});

win1.open();

var win3 = Titanium.UI.createWindow({

title: 'Window 3',
name: 'Window 3',
backgroundColor: '#C4D5DA',
fullscreen: false,
animate: ({opacity: 0,duration: 300 }),
url: 'win3.js'
});

win3.open();

win3.js

var win3 = Titanium.UI.currentWindow;

var body = Titanium.UI.createScrollView({
contentWidth:Titanium.Platform.displayCaps.platformWidth,contentHeight:500,
right:0,left:0,top:60,bottom:50,width:'auto',height:'auto',
showHorizontalScrollIndicator:false,showVerticalScrollIndicator:false});

win3.add(body)

var button = Titanium.UI.createButton({
title:'click to cycle',
top:190,
left:30,
height:50,
width:250,
font:{fontSize:20}
});

body.add(button);
button.addEventListener('click', function(){

win3.close();
win3.open();
});</code>

Comments

  1. pete 2011-04-15

    This happens only on Android.

    is there an echo in here?...

  2. pete 2011-04-15

    Please someone at least acknowledge this bug. My app works perfectly on iPhone but unless this bug is fixed for Android, there is no point in me using this software

  3. Don Thorp 2011-04-15

    You can't close and reopen the same window that you're in.

  4. pete 2011-04-15

    That was just for simplicity sake. I have modified my code to not open/close from the same window with the same result.

    app.js

       Titanium.UI.setBackgroundColor('#000');
       
       var win1 = Titanium.UI.createWindow({  
           backgroundColor:'#000',
           exitOnClose:true,
           navBarHidden:true,
           orientationModes: [Ti.UI.PORTRAIT],
           zIndex:-1
       });
       
       win1.open();
       
       var body = Titanium.UI.createScrollView({
           right:0,left:0,top:60,bottom:50,width:'auto',height:'auto'
           });
           
       var button = Titanium.UI.createButton({
           title:'click to open',
           top:190,
           left:30,
           height:50,
           width:250,
           font:{fontSize:20}
       });
       
       body.add(button);
       win1.add(body);
       
       button.addEventListener('click', function(){
           win3.open();
           });
       
       var win3 = Titanium.UI.createWindow({
           title: 'Window 3',
           name: 'Window 3',
           backgroundColor: '#C4D5DA',
           fullscreen: false,
           animate: ({opacity: 0,duration: 300 }),
           url: 'win3.js'
           });
       

    win3.js

       
       var win3 = Titanium.UI.currentWindow;
       
       var body = Titanium.UI.createScrollView({
           contentWidth:Titanium.Platform.displayCaps.platformWidth,contentHeight:500,
           right:0,left:0,top:60,bottom:50,width:'auto',height:'auto',
           showHorizontalScrollIndicator:false,showVerticalScrollIndicator:false});
       
       win3.add(body)
       
       var button = Titanium.UI.createButton({
           title:'click to close',
           top:190,
           left:30,
           height:50,
           width:250,
           font:{fontSize:20}
       });
       
       body.add(button);
       
       button.addEventListener('click', function(){
       
           win3.close();
           });
       
  5. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source