I have a simple kivy app and I can't hide default android keyboard. I'm try to use android.hide_keyboard() but it don't work in my device. The most interesting thing is that this function works for Pydroid, but on the emulator and on the device the app immediately breaks without python errors. My TextInput code:
class MyTextInput(TextInput):
def __init__(self, **kwargs):
super(MyTextInput, self).__init__(**kwargs)
self.wx = self.x
self.wy = self.y
self.wpos = self.pos
self._keyboard_mode = 'dock'
self.allow_vkeyboard = True
self.single_vkeyboard = True
def on_focus(self, instance, value, *largs):
if platform == 'android':
import android
android.hide_keyboard()
win = self.get_root_window()
if win:
win.release_all_keyboards()
win._keyboards = {}
win.set_vkeyboard_class(MyKeyboard)