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();
Asked
Active
Viewed 86 times
1 Answers
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