0

I am trying to display the soft keyboard. I have found many answers but none of them solve my problem. InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(error[0], InputMethodManager.SHOW_IMPLICIT); error[0].requestFocus();

thepure12
  • 122
  • 1
  • 9

1 Answers1

0

Try This . When you activity starts, Soft Keyboard will popup :-

    this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);

or Add this to the activity on which you want to show soft keyboard when it starts :-

android:windowSoftInputMode="stateVisible"

or if you want soft keyboard to popup on an edit text :-

    InputMethodManager imm = (InputMethodManager)getSystemService(
              Context.INPUT_METHOD_SERVICE);
        imm.showSoftInput(myEditText.getWindowToken(), 0);
Rahul Gupta
  • 5,275
  • 8
  • 35
  • 66