How to disable XT9 in a MultiAutoCompleteTextView screen - android

I have a MultiAutoCompleteTextView implemented on one of my screens. I was testing the application in various smartphones and when I tested in a smartphone that had XT9 turned on the texbox works, however when the word was selected in my textbox the XT9 does not clean the letters already typed, then when I started to type again the previous letters from the first word show up.
So I need to turn of XT9 in this screen or clean XT9 letters list. Someone knows how to do it?
Thanks

I found that to disable the autocomplete of the Input I just needed to add the attribute android:inputType="textAutoComplete" on the MultiAutocompleteTextView's xml

Related

prefered input type EditText [duplicate]

This question already has answers here:
EditText with number keypad by default, but allowing alphabetic characters
(19 answers)
Closed 9 years ago.
This has been asked elsewhere online to no avail. Is there any way in Android to display the numeric soft keyboard when focusing on an EditText, but still allow any text to be entered?
I'd like to let the user enter quantities (e.g. "1 kg", "2 L"), so just setting inputType="number" won't work.
Add the following line of code, and it will do the trick :)
editText.setRawInputType(Configuration.KEYBOARD_QWERTY);
This will show the the numeric keypad first, but also allows you to enter free text.
More information here.
This may be device dependant but have you tried:
android:inputType="phone"
All Input Types Link
in the EditText's xml , this gives you the number pad keyboard but then you can still switch to letter's if you want. (Atleast on my Nexus One).
Note that: setRawInputType(InputType.TYPE_CLASS_NUMBER);
has the desired effect on some devices but not others...
On htc it works fine however on galaxy tab II you only get the numeric keyboard and no way to switch back to alpha.
write the code in XML,
android:numeric="integer"
android:inputType="phone"
android:digits="1234567890"
It looks like the underlying question you're dealing with is: how can I allow the user to enter quantities?
One appropriate answer is: with a numeric input, paired with some form of category select for the unit. e.g. radio, dropdown, or spinner. This is probably easier to use and also saves you the headache of having to validate your input every time.
You could also just have iron cojones and write a custom soft keyboard.
I tried many different combinations before I figured this out, but this appears to work correctly:
setRawInputType(InputType.TYPE_CLASS_NUMBER);
The key lies in the description for setRawInputType(int):
Directly change the content type integer of the text view, without
modifying any other state.

How do I default to numeric keyboard on EditText without forcing numeric input? [duplicate]

This question already has answers here:
EditText with number keypad by default, but allowing alphabetic characters
(19 answers)
Closed 9 years ago.
This has been asked elsewhere online to no avail. Is there any way in Android to display the numeric soft keyboard when focusing on an EditText, but still allow any text to be entered?
I'd like to let the user enter quantities (e.g. "1 kg", "2 L"), so just setting inputType="number" won't work.
Add the following line of code, and it will do the trick :)
editText.setRawInputType(Configuration.KEYBOARD_QWERTY);
This will show the the numeric keypad first, but also allows you to enter free text.
More information here.
This may be device dependant but have you tried:
android:inputType="phone"
All Input Types Link
in the EditText's xml , this gives you the number pad keyboard but then you can still switch to letter's if you want. (Atleast on my Nexus One).
Note that: setRawInputType(InputType.TYPE_CLASS_NUMBER);
has the desired effect on some devices but not others...
On htc it works fine however on galaxy tab II you only get the numeric keyboard and no way to switch back to alpha.
write the code in XML,
android:numeric="integer"
android:inputType="phone"
android:digits="1234567890"
It looks like the underlying question you're dealing with is: how can I allow the user to enter quantities?
One appropriate answer is: with a numeric input, paired with some form of category select for the unit. e.g. radio, dropdown, or spinner. This is probably easier to use and also saves you the headache of having to validate your input every time.
You could also just have iron cojones and write a custom soft keyboard.
I tried many different combinations before I figured this out, but this appears to work correctly:
setRawInputType(InputType.TYPE_CLASS_NUMBER);
The key lies in the description for setRawInputType(int):
Directly change the content type integer of the text view, without
modifying any other state.

Android Edittext display only part of inputted character

I'm having a strange problem with the android edittext inputfield.
I use the edittext field to let the user of an app answer questions that are generated by the app.
Now this works fine...but every now and again.. completely random (i.e. i could not find the pattern) the edittext field stops displaying the input after the first part of the first input character. To test I type in an incorrect answer to the question many times in a row. The problem occurs anywhere between the first and the 500th or so repetition of the wrong answer. It's only a display issue because all the inputted characters can be retrieved from the edittext field (with gettext() ).
I did not find this behaviour on my simulations only on my test phone (samsung galaxy s)
I could not find anything in the log...
The editfield is on a TabHost-tab. When i switch to another tab and return everything is fine again, the same applies to rotating the device to landscape and back.
Did anybody ever encounter this strange behaviour : edittext stops showing text after only part (looks like 1 or 2 leftmost pixels of the character) of the first inputted character..and can point me to a direction ?
I think this is to do with the phone. I was testing one of my apps on a few phones, one of which was a Samsung Europa, and everyone once in a while, the text in the EditText went funny, and on very rare occasions, the EditText boxes didn't render properly. Like you said, changing to landscape and back fixes the problem but I think it's not a problem you can fix, just a problem with Samsung's product.

Why are certain letters on emulator virtual keypad showing numbers in Android EditText with inputtype as "number"?

I have an EditText widget in my Android application with inputtype=number. It does restrict character to entry by number. However, when I type certain alphabetic keys on the emulator's keypad (not all of them) I see numbers appear in the edit box. For example, typing an "F" puts a "6" in the edit box, "D" puts a "5", etc. Why is this happening?
-- roschler
I've seen two things happen, depending if you're on the emulator or on the phone, and depending on the SDK version:
The full keyboard appears (older SDKs). The behavior is exactly what you said: you can only type numbers, but certain characters can also be typed, and are translated to numbers. That behavior is explained by what Aleadam said.
The soft phone keypad (mostly on modern SDKs and phones, as far as I've seen). The typical phone keypad appears... "2ABC", "3CDE" and so on...
On both situations, you will see that, in fact, only numbers can be entered, which is what we want. As an example, in preference screen, you can perfectly cast the Object newValue into a Integer and you won't have any problems.
I do that all the time, don't worry!
It emulates the portrait keyboards that can be used to dial numbers also. Nothing wrong with your particular widget :)
If you enable that tag the emulator keyboard works like a T9.
ABC will be 2
DEF will be 3
etc.
It's normal, it's not a bug!

Android Phone EditText not updating the display on the device

I've got a small Android app that I am developing and I have an EditText element which does not like to display it's contents while the keyboard is on the screeen.
For example I touch the editTextbox and it brings up the keyboard, pressing a letter, say a displays a in the textbox, but after that no new text shows up so the user is essentially typing blind from that point on.
This only happens on the device and not in the emulator. Vodafone 845 if it makes any difference.
The code I am using for the EditText is this.
<EditText
android:id="#+id/EditAddress"
android:layout_width="200px"
android:singleLine="True"
android:hint="Address or Landmark"/>
I did have a OnKeyListener and an OnClickListener, but removing them from the code makes no changes to the behaviour. The EditText is also inside of a TableLayout which is inside of another TableLayout. This is the only EditText that is behaving badly on the device. (I have not coded any others in the application. But might add some just to find out whats wrong.
EDIT: Ok, it seems to be caused if the keyboard obscures the location of the original editbox such that the view has to scroll down so the editbox will not be covered by the software keyboard. For now I can rearrange my page so the edit box is at the top. But this is a bit of a hacky solution. Anyone know what causes this and/or how to fix it.
I think you need to give it a layout_height as well. Even if it is wrap_content or the like.

Categories

Resources