4

It seems that it cannot be achieved through InputMethodManager, but there seems to be a method getHeight() in Keyboard.

Thanks in advance.

EDIT

I am not writing my own input method.

Chao Zhang
  • 1,476
  • 2
  • 14
  • 25

1 Answers1

1

This isn't the perfect answer, but it might help. From what I gather, you are looking for the keyboard height?

https://stackoverflow.com/a/16789324/3436942 suggests that this isn't quite as easy as you would hope, but may be a solution for you?

(1) Is there any way in android to get the height of virtual keyboard of device 's answer here suggests using Viewtree Observer and global layout listener, where you could possibly 'flash' the keyboard on screen (not perfect, I know). Or maybe (somewhere else in the program) store this vairable in a pointer. Then find 'height difference'.

(2) the answer to https://stackoverflow.com/a/6375724/3436942 says you can't, but maybe (again) find the height of your view instead?

Just suggestions, as it seems this question does not have an answer unfortunately.

Community
  • 1
  • 1
jbutler483
  • 24,074
  • 9
  • 92
  • 145