This is possibly an Android 'feature' but I have been wrestling to overcome this for several days and have given up and admit the need for help..
The attached trivial project is a primitive code editor. Run the program on a device and rotate it from portrait to landscape and back - all is well. Now tap on the EditText to open the IME and rotate the device with the IME open, whether from portrait to landscape or vice versa. I now get a problem on some of my devices.
On my Samsung Galaxy A3 (Android 8.0) all is well. The IME closes, the layout redraws correctly and the IME remains closed.
On my Unihertz Jelly Pro (Android 8.1) and my Xiaomi Mi Max 3 (Android10) after rotation the IME re-opens and the layout is not as expected - presumably because the IME is interfering with the apparent Activity size.
The visual results seem to differ slightly between keyboards (GBoard, Smart Keyboard Pro, etc) for the portrait to landscape rotation with the IME open but the landscape to portrait rotation with IME open seems to always be the same. I may be missing the blindingly obvious here but my attempts to programmatically close the IME in Activity_Pause to avoid this problem fail. Has anyone else seen this and has a solution?
The attached trivial project is a primitive code editor. Run the program on a device and rotate it from portrait to landscape and back - all is well. Now tap on the EditText to open the IME and rotate the device with the IME open, whether from portrait to landscape or vice versa. I now get a problem on some of my devices.
On my Samsung Galaxy A3 (Android 8.0) all is well. The IME closes, the layout redraws correctly and the IME remains closed.
On my Unihertz Jelly Pro (Android 8.1) and my Xiaomi Mi Max 3 (Android10) after rotation the IME re-opens and the layout is not as expected - presumably because the IME is interfering with the apparent Activity size.
The visual results seem to differ slightly between keyboards (GBoard, Smart Keyboard Pro, etc) for the portrait to landscape rotation with the IME open but the landscape to portrait rotation with IME open seems to always be the same. I may be missing the blindingly obvious here but my attempts to programmatically close the IME in Activity_Pause to avoid this problem fail. Has anyone else seen this and has a solution?
Attachments
Last edited: