ro Ro
ro Ro

Reputation: 123

Can I force the soft keyboard to launch when receiving Android Bluetooth keyboard input?

I am creating a custom keyboard that displays the Bluetooth keyboard input on the device screen for Android (Google TV)

However, the soft keyboard does not appear when you type on a Bluetooth keyboard.

I want the soft keyboard to appear on the screen when I type on the Bluetooth keyboard.

InputMethodManager mgr = (InputMethodManager) getSystemService(context.INPUT_METHOD_SERVICE);

In the above code, Is it possible to force a soft keyboard to be displayed every time I use a Bluetooth keyboard?
It should be applied wherever you use the keyboard, not only for the View.

Upvotes: 0

Views: 190

Answers (1)

JTeam
JTeam

Reputation: 1505

InputMethodManager inputMethodManager =
    (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.toggleSoftInputFromWindow(
    linearLayout.getApplicationWindowToken(),
    InputMethodManager.SHOW_FORCED, 0);

Upvotes: 1

Related Questions