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
1
vote
1 answer

Text field does not show cursor after starting custom soft keyboard

I have implemented a custom soft keyboard, which is already present in the Play Store and used by many people. In nearly all apps it works fine, but there is one anoying thing only in one app I am trying to solve. If you use the messenger Threema…
1
vote
1 answer

Using getCurrentFocus or getSystemService to get View doesn´t work?

I want to hide the keyboard: View view = this.getCurrentFocus(); if (view != null) { InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); …
Cyb3rKo
  • 413
  • 7
  • 22
1
vote
3 answers

NullPointerException in my Kotlin code despite safeguards

The code snippet below is from my onOptionsItemSelected function. Lines 2-5 below are suppose to hide the soft keyboard if it is showing OR call the activity's finish function otherwise. I got this piece of code from one of the answers to 'How to…
1
vote
1 answer

Xamarin Forms, enable softkeyboard when bluetooth keyboard is connected in Android

Currently, i'm working on my first project with Xamarin forms and android. I have a bluetooth barcode scanner paired with android device. So softkeyboard doesn't appear when it's connected. I tried many options what i found in the internet. Such as…
1
vote
0 answers

Android InputMethodManager with InputConnection null

I am new to android in my project i have option for searching records in database. I have a EditText and a Button whenver user presses a button database will be queried for text entered by user in EditText. It's working fine for first time after…
0
votes
0 answers

Android Custom Keyboard view is displaced to top when dismissing

I am facing an issue with custom keyboard (built with InputMethodService). Below are the steps to reproduce the issue Lanuch keyboard(while focusing on Edit text) Click Home button/other launcher icon Keyboard is displaced to top before dismissing…
0
votes
0 answers

How to identify the View (with text) when the cursor is on it?

How to identify the View (with text) when the cursor is on it? I would like to get the text when the cursor shows any view on the screen.
0
votes
1 answer

In Android, Is there any way to listen Network Changes in the InputMethodService class?

I'm creating a custom keyboard in Android, whenever the keyboard popups, I want to show the popup when the network connection is interrupted, I have tried this in Activity-based classes but this is a different scenario because it's a Service…
FGH
  • 2,900
  • 6
  • 26
  • 59
0
votes
0 answers

Is Android IME a Persistent Process?

I'm building an Android IME app. I'm wondering if my app will be persistently bound to the InputMethodManager and thus persistently kept alive? Or it will be destroyed by low memory killer just like any other app?
0
votes
1 answer

WindowInsets vs InputMethodManager!! Right way to show and hide softkey in android

What should i use; WindowInsets or InputMethodManager to show and hide the soft keyboard in android? Which is the right way of doing the cited task, without compromising the app performance? I want the keyboard show and hide to be smooth.
0
votes
1 answer

InputMethodManager.showInputMethodPicker not showing when custom keyboard in my app is not currently selected

I am implementing a custom keyboard with InputMethodService. Calling showInputMethodPicker from a service that is a chat head (a floating widget like in facebook messenger) when the selected keyboard is my custom one works but if current selected…
0
votes
0 answers

showSoftInput not working for EditText that is inside a Spinner

I have a Spinner in which the dropdown items have a EditText, after trying editText.requestFocus(),the focus comes up on the editText, but the keyboard is not showing up. It tells mServedView != view, which I basically think that the dropdown item…
Akshay Shenoy
  • 1,194
  • 8
  • 10
0
votes
1 answer

showInputMethodPicker not working on devices above Marshmallow?

In the documentation, I saw that showInputMethodPicker Added in API level 3 public void showInputMethodPicker () Show IME picker popup window. Requires the PackageManager#FEATURE_INPUT_METHODS feature which can be detected using…
Manoj Perumarath
  • 9,337
  • 8
  • 56
  • 77
0
votes
2 answers

hideSoftInputFromWindow throws NoSuchMethodError

I have code in Java that hides the soft keyboard using the InputMethodManager. When I convert the code to Kotlin, the same code throws a NoMethodFound exception. I can easily switch between the Java and Kotlin versions and demonstrate the correct…
Gerald
  • 1
  • 1
0
votes
1 answer

Getting keystrokes from the soft keyboard from within a fragment

I have an activity that launches a fragment whose main purpose is to present the user with an Imagebutton that they can click to launch the soft keyboard and type in whatever text they like. I need to grab each key as it is pressed on the soft…