Answers for "prevent keyboard close android"

0

how to prevent keyboard open automatically in android

This is usually a mess. The first thing I try is try to steal the focus with another view via . You also have to have the focusable and focusableInTouchMode.

<TextView
  ...
  android:focusable="true"
  android:focusableInTouchMode="true">

    <requestFocus/>
</TextView>
Posted by: Guest on December-24-2020
-1

close keyboard android

public static void hideSoftKeyboard(Activity activity) {
    InputMethodManager inputMethodManager = 
        (InputMethodManager) activity.getSystemService(
            Activity.INPUT_METHOD_SERVICE);
    inputMethodManager.hideSoftInputFromWindow(
        activity.getCurrentFocus().getWindowToken(), 0);
}
Posted by: Guest on February-20-2021

Code answers related to "prevent keyboard close android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language