Rinks05
Rinks05

Reputation: 31

Soft keyboard won't appear

Hello I want to show up the soft keyboard whenever I tap on the textfield. the application of mine works fine whenever u login for the first time but when i logout from the application it does not pop up.

Upvotes: 0

Views: 796

Answers (3)

dhoodlum
dhoodlum

Reputation: 1223

I have ran into this many a time. Please resist to force the keyboard to show. Any device that has a physical hard keyboard will not show in many different kinds of views. Try running your application on a devices that are not connected to a bluetooth keyboard and does not have a hard keyboard.

Upvotes: 1

FoamyGuy
FoamyGuy

Reputation: 46856

EditText should handle this for you, post some of your code and maybe we can help figure out why it is not doing so. Or you can force the soft keyboard to show by doing something like this:

    InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
    inputMgr.showSoftInput(yourEditText, 0);

If you put that inside the onClick() method for an OnClickListener that you set on your EditText then it will force the keyboard open whenever the EditText is clicked.

Upvotes: 0

Robby Pond
Robby Pond

Reputation: 73484

You can show the soft keyboard focused on a specific EditText like this.

EditText editText = (EditText) findViewById(R.id.edit);
InputMethodManager imm = (InputMethodManager) getSystemService(
    Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);

Upvotes: 1

Related Questions