Can I use the soft keyboard without an EditText?

前端 未结 5 1389
傲寒
傲寒 2020-12-30 02:29

I\'m creating a simple typing game in Android. I have no problem getting input from the physical keyboard, but now I\'m trying to get the soft keyboard to appear without the

5条回答
  •  梦谈多话
    2020-12-30 03:08

    Note that if you are working in landscape mode, the soft input will create its own text input field ruining all your hard work. You can prevent this behavior:

    // This makes us remain invisible when in landscape mode.
    setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    

    Now if you have set up an invisible EditText it will remain as you made it.

提交回复
热议问题