1

i have to detect if the soft-keyboard was opened. i have read some articles here on how to do it, one example is >this< there was another, maybe better one, but the two ar aiming at the same target, to check if the layout/View was forced to resize.

my problem here is, that that all is java code and i can't do anything with java code, because i don't know the Monodroid equivalents of the API, and some other small things...

Antoher thing i figured out is, that there is a InputMethodService.OnWindowShown() method/Event, and a identifier wheter the keyboard is shown or not.

var inputManager = (InputMethodService)GetSystemService(InputMethodService);
inputManager.OnWindowShown();
bool bla = inputManager.IsInputViewShown;

is there a way to identify if the keyboard was opened, with these lines, or do i have to do the resize thing? and if the resize is the only thing, how dos it work in Mono for Android?

Community
  • 1
  • 1
EaranMaleasi
  • 895
  • 1
  • 13
  • 32

1 Answers1

0

You can't detect if soft keyboard is shown or not,but you can indirectly know that a soft key board is shown by knowing that the view of your activity is resized.
This 2 lines hide the soft keyboard..

var input = (InputMethodManager)GetSystemService(InputMethodService);
input.HideSoftInputFromWindow(editText1.WindowToken, HideSoftInputFlags.None);

Also can see..

ridoy
  • 6,274
  • 2
  • 29
  • 60
  • i don't want to hide the keyboard, i want to know if the keyboard was opened so i can hide a tabWidget, taking way to much space on the screen. – EaranMaleasi Jan 31 '13 at 06:57