Hi,
i’ve made this modification to the onCreate() method Cocos2dxEditDialog.java so the keyboard hides when the user pressed the back button, instead of having to press 2 times:
this.mInputEditText = new EditText(this.getContext())
{
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK &&
event.getAction() == KeyEvent.ACTION_UP) {
Cocos2dxHelper.setEditTextDialogResult(Cocos2dxEditBoxDialog.this.mInputEditText.getText().toString());
Cocos2dxEditBoxDialog.this.closeKeyboard();
Cocos2dxEditBoxDialog.this.dismiss();
return true;
}
return super.onKeyPreIme(keyCode, event);
}
};
This is basically inheriting EditText and overriding the onKeyPreIme method. You could inherit it elsewhere and have a better code, but this is easier to share on the forum
EDIT: I’ve also found how we can find out the keyboard height, so we could do like iphone, move the view up and show the in-game field instead of the android native view:
Cheers!