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,579
  • 8
  • 53
  • 86
Awais Ahmad
  • 427
  • 3
  • 17

2 Answers2

1

please try this,

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

Try something like this:

 InputMethodManager imm = (InputMethodManager)getSystemService(MainActivity.this.INPUT_METHOD_SERVICE);
imm.showSoftInput(mainLayout.getWindowToken(), 0);
Krupa Patel
  • 3,309
  • 3
  • 23
  • 28