0

I have a invisible EditText: ReplyInput and a button: ShowReply.

I want to show the ReplyInput and the soft keyboard after ShowReply is clicked.

Anyone has any idea about that?

Thank for reading :)

Nam Vũ
  • 103
  • 1
  • 8
  • 1
    Possible duplicate of [How to open Keyboard on Button click in android?](http://stackoverflow.com/questions/8078004/how-to-open-keyboard-on-button-click-in-android) – K Neeraj Lal Nov 15 '16 at 16:13

2 Answers2

3

Something like that:

InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
manager.showSoftInput(ReplyInput, InputMethodManager.SHOW_IMPLICIT);
Pein
  • 1,059
  • 3
  • 10
  • 31
0

One way is to make EditText visible upon clicking on Button and using InputMethodManager to bring up soft keyboard (Here's how to do it), but there's a better way and that is to show EditText and then put focus on it, this way soft-keyboard will be brought up automatically.

Community
  • 1
  • 1
M. Erfan Mowlaei
  • 1,376
  • 1
  • 14
  • 25