开发者

Why isn't the virtual keyboard closed properly

开发者 https://www.devze.com 2023-03-23 23:04 出处:网络
I\'m running a program which is calling a mmSocket.connect() -procedure in which a bluetooth pairing-process is start开发者_JAVA技巧ed. If the phones aren\'t paired a dialog shows up after the code

I'm running a program which is calling a mmSocket.connect() -procedure in which a bluetooth pairing-process is start开发者_JAVA技巧ed. If the phones aren't paired a dialog shows up after the code is entered on the device I want to connect with.

Why isn't the virtual keyboard closed properly

Sometimes the connection breaks and the dialog is terminated leaving the keyboard visual in the background.

Why isn't the virtual keyboard closed properly

Haven't found a way to close that keyboard. Have already tried the following:

  • getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); which should work if you ask me...

As always, any help is appreciated


You can hide the keyboard with the following code:

InputMethodManager imm = (InputMethodManager) getSystemService(
    Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(triggeringView.getWindowToken(), 0);

where triggeringView is the view that has shown the keyboard


This is now listed as a bug, please see the following link for info:

Google Code issue - 18911

0

精彩评论

暂无评论...
验证码 换一张
取 消