0

Here is the method on buttonclick but it is not working... i have tried many things but nothing seems to be work

public void open_keyboard(View view)
{
    message.msg_l(this, "keyboard clicked");
    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT);
}
Ziem
  • 6,059
  • 7
  • 49
  • 83
Awais Ahmad
  • 417
  • 3
  • 16

2 Answers2

1

please try this,

InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
Jignesh Jain
  • 1,438
  • 12
  • 26
0

Try something like this:

 InputMethodManager imm = (InputMethodManager)getSystemService(MainActivity.this.INPUT_METHOD_SERVICE);
imm.showSoftInput(mainLayout.getWindowToken(), 0);
Krupa Patel
  • 3,163
  • 3
  • 19
  • 27