android-input-method

Android: Determine active input method from code

浪尽此生 提交于 2019-11-26 09:43:26
问题 How do you determine which input method is currently active - A user can change the input method (soft keyboard) by long pressing on a text edit field - From code, how does one determine which input method the user has chosen 回答1: I realise you probably don't need this anymore, but someone might want the answer to this. You can use this line to get the String ID of the Input Method in use: String id = Settings.Secure.getString( getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD ); If

How to set visibility Android Soft Keyboard

邮差的信 提交于 2019-11-26 01:17:43
问题 I have an EditText and a Button in my layout. After writing in the edit field and clicking on the Button , I want to hide the virtual keyboard. I assume that this is a simple piece of code, but where can I find an example of it? 回答1: To help clarify this madness, I'd like to begin by apologizing on behalf of all Android users for Google's downright ridiculous treatment of the soft keyboard. The reason there are so many answers, each different, for the same simple question because this API,

Disabling the fullscreen editing view for soft keyboard input in landscape?

牧云@^-^@ 提交于 2019-11-26 00:46:04
问题 On Android devices that use soft keyboards, I want to prevent the fullscreen keyboard editing view (shown below) from appearing when in landscape mode (i.e. I want to see only the soft keyboard itself and my view behind it). I assume this can be achieved using the setExtractViewShown(false) method on InputMethodService , but I am unable to access the default instance of this and do not want to implement a custom input method. Edited to add: the view to which input is going is not a TextView