As I understood android: windowSoftInputMode = "stateUnchanged"
will remember the state.
Example: The keyboard is open, the application went to onStop, then when the application returned to onResume I assume the keyboard will reopen, but it doesn't, it is closed. I tried it both programmatically and on different phones. Please tell me how to achieve the desired result, as in whatsapp and telegram