Skip to main content

How to close or hide the android soft Keyboard

Solution:
You can force the android to close the virtual keyboard.
hideSoftInputFromWindow function to close the virtual keyboard


Code:
View myview = this.getCurrentFocus();
if (myview != null) {      InputMethodManager inm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
    inm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}

Comments

Post a Comment

Popular posts from this blog

Local variable for "serviceWorkerVersion" is deprecated in flutter

Problem:  Local variable for "serviceWorkerVersion" is deprecated. Use "{{flutter_service_worker_ version}}" template token instead. See  https://docs.flutter.dev/ platform-integration/web/ initialization  for more details. While try to run my flutter app in chrome it shows the above error. Solution: In script file it shows as like below < script > // The value below is injected by flutter build, do not touch. var serviceWorkerVersion = null ; </ script > Replace with below.It will works fine. < script > // The value below is injected by flutter build, do not touch. var serviceWorkerVersion = "{{flutter_service_worker_ version}}" ; </ script >