Need a previous and next button above the keypad

后端 未结 3 646
感动是毒
感动是毒 2021-01-06 12:39

I want to show the virtual keyboard with Prev, Next Buttons above the keyboard.

When the user clicks prev button, cursor should move to the previous edit-text input

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 12:52

    Android code to override the "Done" button in my EditText field:
    
    myEditField.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_DONE) {
    
                   InputMethodManager imm =(InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
                   imm.hideSoftInputFromWindow(getWindowToken(), 0);//hide the keyboard.
    
                    return true;
                }
                return false;
            }
        });
    

提交回复
热议问题