[TIMOB-13680] Android: functionality or some event to get hide keyboard button press event.
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 3.0.2, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | android, mobilesdk, nexus, titanium |
Reporter | Ashish Nigam |
Assignee | Ashraf Abu |
Created | 2013-04-26T09:50:11.000+0000 |
Updated | 2016-06-30T04:37:13.000+0000 |
Description
When we click on any text field or text area then on Nexus device where hardware back button actually now soft touch button, gets converted to Hide Keyboard button.
There is not such event or callback through which we can get this event.
**sample code**
var win1 = Ti.UI.createWindow({
backgroundColor:"gray",
focusable:true
});
var button1 = Ti.UI.createButton({
top:10,
left:10,
height:100,
width:200,
title:"click me",
focusable:true
});
var txt1 = Ti.UI.createTextField({
top:150,
left:10,
height:200,
width:400,
value:"type here",
focusable:true
});
txt1.addEventListener("keypressed",function(){
alert("keypressed text field");
});
txt1.addEventListener("blur",function(){
alert("blur txt");
});
txt1.addEventListener("keypressed",function(){
alert("window keypressed");
});
win1.addEventListener("keypressed",function(){
alert("windows keypressed");
});
win1.addEventListener("blur",function(){
alert("blur window");
});
win1.add(txt1);
win1.open();
Steps to check:
1: Use this code in app.js and install the app on nexus 7 device.
2: tap on the text field and then see the android back button.
3: Note that back button is converted to hide keyboard button.
4: now when we press this button then no event is there to find that.
5: keyboard hide without any possibility to detect this touch event on back button.
You can add an event to 'androidback', which will fire when user hits the hardware back button. If not, can you clarify your use case for this particular event that you are requesting? Thanks,