android-inputtype

Redrawing EditText after changing InputType

假装没事ソ 提交于 2021-02-08 07:57:20
问题 I have made a class that is responsible for monitoring an EditText widget following the Observer pattern. Its sole function is to disable or re-enable auto-correct based on a method call. I am able to successfully achieve this, but the problem is that the new InputType only applies to new text I add to the EditText - old text still retains the red underline to show that it can be auto-corrected. Is there any way I can force the new InputType to apply to the entire EditText block, and not

Android Webview Strategy For Deleting Images Causing Speech-To-Text to Fail

◇◆丶佛笑我妖孽 提交于 2021-01-28 07:07:28
问题 Problem: Can't delete image in contenteditable div on Android Only known solution at the moment: Android: Backspace in WebView/BaseInputConnection Problem with solution: Setting: creating a BaseInputConnection using the regular constructor seems to disable speech to text from functioning correctly. as opposed to using WebView.onCreateInputConnection(EditorInfo) to generate an InputConnection. any ideas how to remedy this? 回答1: I had the same issue also with text completion using SwiftKey. In

setKeyListener will override setInputType and change the keyboard

怎甘沉沦 提交于 2020-05-13 07:33:20
问题 Hi everyone I'm having a problem between two devices. In practice using the InputType and the KeyListener I'm manipulating an EditText to make it receive the commas and numbers from the numeric pad (for more background check my previous question). Using the following code I'm able to do something like that: editText.setInputType(InputType.TYPE_CLASS_NUMBER + InputType.TYPE_NUMBER_FLAG_DECIMAL); editText.setKeyListener(DigitsKeyListener.getInstance("0123456789,")); Unfortunately this doesn't

Android Get EditText Input Type At Runtime

痞子三分冷 提交于 2020-01-21 05:03:16
问题 I have a custom implementation of an edit text class. Based on these XML attribute..... android:inputType="textPersonName" android:inputType="textPersonName" android:inputType="textEmailAddress" android:inputType="textPassword" I want to be able to know this at run time (In Java Code) I have found this method which gives me the input type getInputType() And these are the values returned based on the XML I posted above. 97,97,33,129 However, these do not correspond to the constant values

android inputType=phone not working

一个人想着一个人 提交于 2020-01-04 14:18:32
问题 I am trying to get the inputType=phone to work consistently. It works perfectly in one project, but I can't get it to work in any other project. By "work", I mean that the number is not formatted as the value is typed. Here's a test project that does not work. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android

how to get user keyboard language

旧时模样 提交于 2019-12-25 06:44:34
问题 I am writing an application which is using a edit text .i want to know whats users input language in oncreate method or when keyboard input type changes. Is there any way to set a listener to get that change? All the answer i found were about locale and not about input language. I don't want to handle locale, locale has no effect in application, the input language does. i used this codes. private void printInputLanguages() { List<InputMethodInfo> ims = imm.getEnabledInputMethodList(); for

how to get user keyboard language

拜拜、爱过 提交于 2019-12-25 06:42:19
问题 I am writing an application which is using a edit text .i want to know whats users input language in oncreate method or when keyboard input type changes. Is there any way to set a listener to get that change? All the answer i found were about locale and not about input language. I don't want to handle locale, locale has no effect in application, the input language does. i used this codes. private void printInputLanguages() { List<InputMethodInfo> ims = imm.getEnabledInputMethodList(); for

How to use android:inputType on an EditText to specify my custom IME?

岁酱吖の 提交于 2019-12-24 20:44:07
问题 My app includes a custom IME (that extends InputMethodService) and I would now like to specify this as the IME for all the EditTexts within my app. Specifying an android:inputMethod for each EditText seems to be one old way of doing it, but android:inputMethod is now deprecated. The tooltip says to use android:inputType instead. My existing code for one EditText is android:inputType="numberPassword" , but when I change this to android:inputType=".MyCustomIME" (or android:inputType="com

Android textinput where the user can write digits and '/' [duplicate]

一个人想着一个人 提交于 2019-12-24 07:57:48
问题 This question already has answers here : Validation allow only number and characters in edit text in android (8 answers) How to restrict the EditText to accept only alphanumeric characters (12 answers) EditText which accepts only a few characters (7 answers) Closed last year . My user has to enter a string like 21/99 where digits and the sign / are the only valid signs that the user can enter, ideally those would all be shown on the keyboard and little other signs. Unfortunately, neither

Android textinput where the user can write digits and '/' [duplicate]

让人想犯罪 __ 提交于 2019-12-24 07:57:35
问题 This question already has answers here : Validation allow only number and characters in edit text in android (8 answers) How to restrict the EditText to accept only alphanumeric characters (12 answers) EditText which accepts only a few characters (7 answers) Closed last year . My user has to enter a string like 21/99 where digits and the sign / are the only valid signs that the user can enter, ideally those would all be shown on the keyboard and little other signs. Unfortunately, neither