Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between InputMethodManager SHOW_FORCED and SHOW_IMPLICIT in Android

I would like to know the behavioral difference of the constants SHOW_FORCED andSHOW_IMPLICIT. I tried both and couldn't see any difference in the first look.

like image 963
Ravjit Singh Avatar asked Sep 21 '15 14:09

Ravjit Singh


People also ask

How secure is the Android input method framework?

The Android input method framework also allows arbitrary third party IMEs, so care must be taken to restrict their selection and interactions. Here are some key points about the security architecture behind the IMF: Only the system is allowed to directly access an IME's InputMethod interface, via the BIND_INPUT_METHOD permission.

What happens if the input method doesn't have any subtypes?

If the last input method didn't have any subtypes, the framework will simply switch to the last input method with no subtype specified. Supplies the identifying token given to an input method when it was started, which allows it to perform this operation on itself.

What is an input method (IME)?

An input method (IME) implements a particular interaction model allowing the user to generate text. The system binds to the current input method that is use, causing it to be created and run, and tells it when to hide and show its UI. Only one IME is running at a time.

What is the input method manager?

The input method manager as expressed by this class is the central point of the system that manages interaction between all other parts. It is expressed as the client-side API here which exists in each application context and communicates with a global system service that manages the interaction across all processes.


1 Answers

SHOW_FORCED and SHOW_IMPLICIT work in tandem with the hiding methods HIDE_IMPLICIT_ONLY and HIDE_NOT_ALWAYS.

Using SHOW_FORCED indicates that the user has explicitly requested that the keyboard be shown (such as by pressing an "open keyboard" button), and thus the system should force it to open. In this case, any existing request to hide the keyboard using the above flags will be ignored (thus the keyboard is "forced" open).

Using SHOW_IMPLICIT means that your app thinks the user wants the keyboard open, but hasn't explicitly requested it. In this case, requests to hide the keyboard with HIDE_IMPLICIT_ONLY or HIDE_NOT_ALWAYS will still be respected.

like image 50
Bryan Herbst Avatar answered Nov 01 '22 17:11

Bryan Herbst