-1

I typed phone number into edittext. then i want to go next view, because of the next view hide by keyword, so how can i hide this, during this situation, how can i handle this?

enter image description here

  • 1
    Possible duplicate of [Close/hide the Android Soft Keyboard](https://stackoverflow.com/questions/1109022/close-hide-the-android-soft-keyboard) – PradyumanDixit Nov 12 '18 at 03:39

1 Answers1

0

To hide the soft keyboard after you have finished typing and clicked on enter button.

Textview.setOnEditorActionListener(new TextView.OnEditorActionListener()
    {

        @Override

        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

            if (actionId == EditorInfo.IME_ACTION_DONE) {

              //your content

               }

             /*This code will basically hide the keyboard*/

            InputMethodManager imm = 
            (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
             imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); 


            return false;
        }
    });

In this code after you have finished typing user will hit enter key and keyboard will hide the soft keyboard.

androider
  • 104
  • 13