2017-07-12 2 views
0

Android(Google TV)のデバイス画面にBluetoothキーボード入力を表示するカスタムキーボードを作成しています。ただし、Bluetoothキーボードで入力するとソフトキーボードは表示されません。Android Bluetoothキーボード入力を受け取ったときにソフトキーボードを強制的に起動できますか?

Bluetoothキーボードを入力すると、ソフトキーボードが画面に表示されます。

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

上記のコードでは、Bluetoothキーボードを使用するたびにソフトキーボードを表示することはできますか?
キーボードを使用している場合は、表示用だけでなく、どこにでも適用する必要があります。

答えて

1
InputMethodManager inputMethodManager = 
    (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
inputMethodManager.toggleSoftInputFromWindow(
    linearLayout.getApplicationWindowToken(), 
    InputMethodManager.SHOW_FORCED, 0); 
関連する問題