You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem happen when activity attribut: android:configChanges="orientation" is used in the manifest.
With this attribute set, the activity is not destroyed/recreated when we change orientation.
That mean that KeyboardWatcher is not destroyed/recreated neither.
So the initialValue is now wrong and since the detection of the presence of the keyboard is base on that, onKeyboardClosed() and onKeyboardShown() are thrown wrongly.
So it would be nice to add support for that use case, for example add a resetInitialValue method or something like that.
For now the solution I found is to destroy/recreate the KeyboardWatcher in the onConfigurationChanged method:
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (mKeyboardWatcher != null) {
mKeyboardWatcher.destroy();
mKeyboardWatcher = new KeyboardWatcher(this);
mKeyboardWatcher.setListener(this);
}
}
The text was updated successfully, but these errors were encountered:
This problem happen when activity attribut: android:configChanges="orientation" is used in the manifest.
With this attribute set, the activity is not destroyed/recreated when we change orientation.
That mean that KeyboardWatcher is not destroyed/recreated neither.
So the initialValue is now wrong and since the detection of the presence of the keyboard is base on that, onKeyboardClosed() and onKeyboardShown() are thrown wrongly.
So it would be nice to add support for that use case, for example add a resetInitialValue method or something like that.
For now the solution I found is to destroy/recreate the KeyboardWatcher in the onConfigurationChanged method:
The text was updated successfully, but these errors were encountered: