Questions tagged [inputmethodmanager]

The InputMethodManager is an Android API for interacting with input methods (keyboards, etc.)

Here is the Android documentation for InputMethodManager.

33 questions
35
votes
3 answers

Main Activity is not garbage collected after destruction because it is referenced by InputMethodManager indirectly

I followed "Avoiding Memory Leaks" article from here. However the proposed solution does not solve the leak problem. I tested this with android emulator on Windows XP (SDK 2.3.1). I dumped the heap and checked the main activity is still in the heap…
7
votes
2 answers

Can I use the Android InputMethodManager on a custom in-app keyboard?

The InputMethodManager is a service that apps can use to interact with the system keyboards. Editors like EditText also use it to indirectly notify the keyboards of changes (for example, updateSelection). I can get a reference to the…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
4
votes
1 answer

android InputMethodManager input type

Is it possible to get the current input type (text or numbers) from keyboard? Or is there an event that is triggered when input type is changed? I need to set input type on a screen based on what input type was when user exited that screen. Thanks
Buda Gavril
  • 21,409
  • 40
  • 127
  • 196
4
votes
1 answer

showInputMethodPicker from notification not working in Android 9

My app sometimes shows a notification to simplify switching to the app's internal input method. Therefore, I am executing ((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).showInputMethodPicker(); when the user clicks the…
Philipp
  • 11,549
  • 8
  • 66
  • 126
3
votes
1 answer

InputMethodManager keyword is not defined in android app

I am trying to use the following code to hide the soft keyboard when a user clicks a button: InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE); …
Jay
  • 89
  • 1
  • 10
3
votes
2 answers

showSoftInputFromInputMethod is deprecated Android P API 28

The showSoftInputFromInputMethod method from the InputMethodManager class is deprecated in Android P. As per the documentation, we should be using the InputMethodService.requestShowSelf(int) method for Android P and above. Now the question is how…
2
votes
0 answers

Android Keyboard/IME switched listener

I have developed a custom keyboard. I ask the user to switch to it using inputMethodManager.showInputMethodPicker(). How can i implement a listener that gets invoked when the user actually changes the keyboard/ime while using my…
2
votes
1 answer

Android : How to prevent softkeyboard hidden when hardwarekeyboard input

I created EditText and applied it to the showSoftInput of InputMethodManager. When I enter a physical key, the keyboard is automatically hidden. I want to prevent the keyboard from automatically being hidden. I've tried the method below. 1. use…
2
votes
1 answer

Stack Overflow Error caused by Software keyboard using InputMethodManager

I'm trying to show/hide the soft keyboard manually inside the in my activities for the edit text view on focus, but on some device, it's showing sys/err and causes crash or ANR in my app with following stack traces Fatal Exception:…
baldraider
  • 1,049
  • 2
  • 18
  • 48
2
votes
3 answers

Android Studio - Input Method Manager

Android studio version :2.3.3 The code below is not working and it should hide the keyboard but its not.Please help. InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); public void…
rahuman aslam
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

InputMethodManager showSoftInput method

What is the purpose of the method showSoftInput in class InputMethodManager? I am new to android, and well for me the documentation is not very clear : Explicitly request that the current input method's soft input area be shown to the user, if…
Moussa
  • 4,066
  • 7
  • 32
  • 49
2
votes
3 answers

InputMethodManager show numpad in webview

I'm using the InputMethodManager to programmatically display the softkeyboard when it's needed InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(view, 0); Is there anyway to force the…
Lachlan Goodhew-Cook
  • 1,101
  • 17
  • 31
1
vote
0 answers

How to use #getSystemService in Maui?

I'm implementing a Maui app, and got stuck with the bug whereby the soft keyboard is not displayed when an Entry control gains focus. The entry control is focused, the cursor blinks, the keyboard remains hidden. (For the other way around, hiding the…
balintn
  • 988
  • 1
  • 9
  • 19
1
vote
2 answers

Android 12 ignoring showSoftInput as VIEW is not served

My app worked fine for lots of devices. But since upgrading to Android 12 on my own Pixel the following happens when calling showSoftInput or just when tapping the AppCompatEditText in a Bottomsheet. val imm =…
1
vote
0 answers

Android IME App Started when No EditText is in Focus

I'm developing an IME keyboard app for Android devices. I found that even when I open an app without clicking on an EditText widget, the onStartInput method of my app would be called. Basically for any app start (it doesn't matter which app I switch…
1
2 3