Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var textfield = Ti.UI.createTextfield();
- textfield.addEventListener('android:back', function() {
- // this method is never called, so this event does not run on textfield
- });
- textfield.addEventListener('focus', function() {
- // this method is called at step 1
- });
- textfield.addEventListener('blur', function() {
- // this method is not called at step 2 because
- // the back button only hide the keyboard but the focus is not lost
- });
- // what code should I use to catch event when the keyboard is hidden
- // when pressing the back button ?
- textField.addEventListener('blur', function(e) {
- var val = e.value; // Get current value when the keyboard closed (the right way) as opposed to textField.value (the wrong way)
- alert("The text is : "+value);
- });
- var win = Ti.UI.currentWindow;
- win.addEventListener('android:back', function(e) {
- // do crazy things
- });
Add Comment
Please, Sign In to add comment