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,351
  • 7
  • 51
  • 85
Awais Ahmad
  • 427
  • 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,478
  • 12
  • 26
0

Try something like this:

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