问题
I am enabling orientation change in focusChangeListener
of an edittext
in my app.
It is working fine, but the issue is if the user flips the keyboard to landscape mode keyboard disappears.
It will come up only if user tap on edittext
again or change orientation to portrait mode.
I need to display keyboard in landscape mode without touching the edittext
.
Please help me.
回答1:
Generally, its a bad idea to mess with the default IME behavior because there are devices out there with hardware keyboards.
Now, that you have been warned, listen for the orientation change and if the keyboard was visible before the change and there is no hardware keyboard on the device, show the keyboard manually.
回答2:
Try using android:configChanges="orientation"
into your manifest class.
<activity
android:name=".classname"
android:configChanges="keyboardHidden|orientation"
>
if works then accept it.
来源:https://stackoverflow.com/questions/12003584/keyboard-disappears-while-orientation-change-to-landscape-mode