Сейчас у меня есть этот код:
Для макета:
Код: Выделить всё
Код: Выделить всё
private void showKeyboard() {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
//getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
});
}
private void registerKeyboardClickCallback() {
final TextView keyboard = (EditText) findViewById(R.id.keyboardPassword);
keyboard.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
//action
}
return false;
}
});
}
Подробнее здесь: https://stackoverflow.com/questions/323 ... w-keyboard
Мобильная версия