[ACCEPTED]-OnScreen keyboard opens automatically when Activity starts-scrollview
Android opens the OnScreenKeyboard automatically 3 if you have an EditText
focussed when the Activity 2 starts.
You can prevent that by adding following 1 into your Activity's onCreate
method.
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
If you want to do it editing the AndroidManifest:
<activity
android:name=".Dades"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden">
the 2 line android:windowSoftInputMode="stateHidden"
is the one that prevents the keyboard 1 focus.
Another way is by adding on LinearLayout:
android:focusable="true"
android:focusableInTouchMode="true"
Let 2 me indicate that
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
still does the same thing, but 1 the cursor is still there.
This will an inappropriate behaviour
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
but 2 it will do it smoothly(do it in manifest
for that 1 activity)
android:windowSoftInputMode="stateHidden"
You can use below statement also,
(EditTextName).setInputType(0)
it will 2 permanently hides default keyboard of perticular 1 Edittext, even on EditText Touch or Click.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.