Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dont want soft keyboard to automatically show on launch - Android [duplicate]

Tags:

Every time I open my android app, it automatically focuses the EditText box and the soft keyboard opens up. Is there a way to focus something else on start up so the keyboard doesn't show right away?

like image 941
user1255273 Avatar asked Jul 18 '12 13:07

user1255273


People also ask

How do I hide the activity on my keyboard?

You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow , passing in the token of the window containing your focused view. This will force the keyboard to be hidden in all situations. In some cases you will want to pass in InputMethodManager.


2 Answers

You can try:

android:windowSoftInputMode="stateHidden"

for your activity in AndroidManifest.xml

like image 148
Vyacheslav Shylkin Avatar answered Nov 18 '22 08:11

Vyacheslav Shylkin


Add this two lines to you main layout.

android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
like image 30
MAC Avatar answered Nov 18 '22 10:11

MAC