Created
September 6, 2011 20:35
-
-
Save jonalter/1198871 to your computer and use it in GitHub Desktop.
Android: exitOnClose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win1 = Ti.UI.createWindow({ | |
| backgroundColor : 'white', | |
| fullscreen: true, | |
| exitOnClose: true | |
| }); | |
| var button = Ti.UI.createButton({ | |
| title : 'Open', | |
| width : 150, | |
| height : 40, | |
| top : 20 | |
| }); | |
| win1.add(button); | |
| button.addEventListener('click', function() { | |
| var win2 = Ti.UI.createWindow({ | |
| backgroundColor: 'blue' | |
| }); | |
| win2.open(); | |
| win2.addEventListener('android:back', function(e){ | |
| win1.close(); | |
| }); | |
| }); | |
| win1.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment