0

I need to hide/show some parts of an activity when the keyboard open/closes. Such method does not exist. By searching the internet I've found that I should override the View's onSizeChanged() like this: Android: onSizeChanged, an example? .

But I have no idea where to put that line of code, nor how to assign it to an already defined RelativeLayout. So how to Override onSizeChanged()?

Thanks in advance

Community
  • 1
  • 1
Ziad Akiki
  • 2,601
  • 2
  • 26
  • 41

1 Answers1

0

There is no onSizeChanged, but there is onConfigurationChanged,

refer to this question for more details: How to capture the "virtual keyboard show/hide" event in Android?

Community
  • 1
  • 1
Ali Alnoaimi
  • 2,278
  • 2
  • 21
  • 31
  • Then use this method http://stackoverflow.com/questions/13534365/getting-the-dimensions-of-the-soft-keyboard , compare the heights of the screen to detect whether the keyboard is visible or no, but it's always recommended to stick to the standard method. – Ali Alnoaimi Sep 02 '13 at 14:50