0

From readings, I have the height of the soft keyboard with the onSizeChanged method. What I want to do is to display a list in place of the soft keyboard when it is closed, and remove the list when the keyboard is required again.

The way I'm doing it at the moment is that when a button is pressed, a list will be made visible and the keyboard dismissed using the InputMethodManager. The problem in the button's onClick method, I set the list to be visible, but the keyboard hiding animation is still ongoing. This causes a visible flicker to happen, since the set visible call triggers the layout to be redone, and the list becomes visible while the keyboard is still there, pushing other views out of sight to the top. After the keyboard animation is finished, other views become visible again, this process causes a visible flicker...

Anyone got any suggestions on how I should approach this?? Pulling my hair at the moment, since setting the list visible during onLayout or onSizeChanged doesn't let the list become visible...

Thanks!!! Dave.

dvd
  • 1,440
  • 1
  • 16
  • 24
  • Did the selected answer help you? I think that I have left a similar question here: http://stackoverflow.com/questions/35585538/hide-the-android-soft-keyboard-without-affecting-the-layout/35625311?noredirect=1#comment58936916_35625311 How did you manage to solve your problem? – Petrakeas Feb 26 '16 at 12:08

1 Answers1

1

you can implement onConfigurationChanged(Configuration) method in your activity. Also, to get this method called you should add information in your manifest file to specify in what situations the method should be called like that:

android:configChanges="keyboardHidden|orientation"

Look here for additional details.

Community
  • 1
  • 1
Vladimir Ivanov
  • 41,277
  • 17
  • 74
  • 99