0
이벤트를 잡는 방법이 있습니까?소프트 키보드가 나타날 때 이벤트를 잡는 방법
편집 상자 내부를 클릭하면 소프트 키보드가 나타납니다.
콜백 기능이있는 소프트 키보드가 나타납니다. 가능한가?
이벤트를 잡는 방법이 있습니까?소프트 키보드가 나타날 때 이벤트를 잡는 방법
편집 상자 내부를 클릭하면 소프트 키보드가 나타납니다.
콜백 기능이있는 소프트 키보드가 나타납니다. 가능한가?
//Clicking on the text box
edittext.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
InputMethodManager imm = (InputMethodManager) getSystemService(
INPUT_METHOD_SERVICE);
imm.showSoftInput(getCurrentFocus().getWindowToken(), //some flag here);
}
});
//Being inside the box and pressing a key
edittext.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
//If the event is a key-down event on the "enter" button
//If enter is pressed while inside the textbox
if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
(keyCode == KeyEvent.KEYCODE_ENTER)) {
InputMethodManager imm = (InputMethodManager) getSystemService(
INPUT_METHOD_SERVICE);
//Example of hiding keyboard inside enter pressed check
imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
........