4

AFAIK, Android doesn't provide any API to check the visibility of software keyboard. And most recommended/used way to check visibility of s/w keyboard is as mentioned in How to check visibility of software keyboard in Android? , that is, by measuring the size/height of app window, if it is considerably lesser than device size, that means s/w keyboard is up. this works perfectly fine on Android version <= M with apps occupying full screen. But from Android N, apps can be in multi-window mode, this method of checking visibility of s/w keyboard will not work.

Any fool proof way to check visibility of s/w keyboard in multi-window mode?

Community
  • 1
  • 1
pardeepk
  • 326
  • 2
  • 8
  • For what purpose would you need to know if the soft keyboard is visible or not? Are you creating some UI testing tool that is supposed to do automated typing on the keyboard? If so, maybe an AccessibilityService would be what you need. – Michael Aug 02 '16 at 09:07
  • @Michael - No, I don't need it for testing tool but for my app. My app have scenarios where it need this. E.g. It has a Edit control, and a menu button. So before launching menu, it checks if s/w keyboard is up, and after it get dismissed, it re-launch/show s/w keyboard if it was showing before menu was launched. – pardeepk Aug 03 '16 at 09:28
  • Hey @pardeepk, Did you find the solution? I'm also having the same problem. – Vijay Nov 26 '17 at 19:15

0 Answers0