Difference between InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD and TYPE_TEXT_VARIATION_PASSWORD

How do you know whether to use android.text.InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD or android.text.InputType.TYPE_TEXT_VARIATION_PASSWORD ?

Documentation TYPE_TEXT_VARIATION_WEB_PASSWORD :

Change TYPE_CLASS_TEXT: enter the password inside the web form. This has been added to HONEYCOMB. The IME must focus on this version of the API or later to see this type of input; if this is not the case, the request for this type will be considered as TYPE_TEXT_VARIATION_PASSWORD when passed through EditorInfo.makeCompatible (int).

Documentation TYPE_TEXT_VARIATION_PASSWORD :

Change TYPE_CLASS_TEXT: password entry.

In this case, the form is considered a "web form"? Is there a difference in behavior between the two? (visually and / or logically)

+5
source share
1 answer

In this case, the form is considered as a "web form"?

If EditText (html input field) is inside the browser page (any web form that accepts data from the user).

We need to use InputType TYPE_TEXT_VARIATION_WEB_PASSWORD in case of web-from.

if EditText is an EditText object in your own application, then you need to use TYPE_TEXT_VARIATION_PASSWORD

Is there a difference in behavior between the two? (visually and / or logically)

YES,

See com.android.inputmethod.latin.InputAttributes here:

Flag used

TYPE_TEXT_VARIATION_WEB_EDIT_TEXT :

  // If it a browser edit field and auto correct is not ON explicitly, then // disable auto correction, but keep suggestions on. // If NO_SUGGESTIONS is set, don't do prediction. // If it not multiline and the autoCorrect flag is not set, then don't correct 

But in the case of TYPE_TEXT_VARIATION_PASSWORD InputType above the comments are not TRUE.

+4
source

All Articles