Search code examples
androidandroid-jetpack-compose

How can I hide the system keyboard and use my own custom keyboard when a TextField is focused in Android Jetpack Compose?


I want to use my own custom keyboard instead of the system keyboard, how to hide system keyboard when TexField is focused

I try

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

but didn't work.


Solution

  • To hide the system keyboard try to use:

     CompositionLocalProvider(
            LocalTextInputService provides null,
        ) {
         BasicTextField()
        }