Prevent Edittext from opening keyboard when I enter the layout

Asked

Viewed 539 times

1

Whenever I enter a layout that has a EditText, It opens the digital keyboard by default for me to write something. I wanted to stop this, I wanted him to show the keyboard only when I clicked on EditText.

  • 1

    Ever tried to focus on something else? Besides, you didn’t mean Edittext when you said Textfield?

  • Exactly, I’ve corrected

  • How can I focus?

  • I remembered a better option. See the answer.

1 answer

2


You can add to your declaration Activity in Manifest one of the following options:

To always enter with the hidden keyboard

android:windowSoftInputMode="stateHidden"

To leave it as it is (that is, if the keyboard was already open when it arrived at it, it remains open. If it was not, it remains closed):

android:windowSoftInputMode="stateUnchanged"

Analyze which option is best suited to your case and choice.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.