I have placed an edit box and in that box the user has to type his email id and when he clicks a button it must be send to network.
When the user starts typing his name it gives some suggestions above the default keypad of the device, if the user selects one among them a small space appears after the name that gets selected.
If it is to be the last name no problem but if he is to type anything next to the word it goes on with a space and it creates problem in getting return data from network.
how to disable the the word suggestions....
Try textNoSuggestions value for the android:inputType attribute.
For example:
android:inputType="textFilter|textMultiLine|textNoSuggestions"
You need to set the input type to no suggestions. There is also an input type for email addresses. From 2.1 on, the input type can be set in the layout.
Related
The input type for my EditText control is set to "number." When the numeric keypad is displayed, besides showing the numbers, it also shows calculator keys (+/-/etc.). I am wondering if there is any setting to remove the calculator keys.
Thank you in advance for your help.
If all you need are actual numbers 0-9 you could set your keyboard type to "phone" instead of "number" which should give you a more 9-pad style keyboard that probably won't contain the extra keys like +, - etc...
However in the end it is up the currently running keyboard application (which is chosen by the user) If whatever keyboard they happen to be using shows keys that you would rather it not, there is generally no way for you to instruct it not to show those keys.
If you want to have complete control over the input then you'll have to create your own View that mimics the functionality of the keyboard and "manually" insert the typed characters into your EditText.
Add this line of code
input.setInputType(InputType.TYPE_CLASS_NUMBER);
Hope it helps.
I am currently working on android project, I want to allow the user to hide or show their password on the screen by selecting a checkbox.
How would I go about replacing every character in the string with * character or is there a particular way to do this.
For example if the password is my_password I want it to be replaced with ***********.
You can use setTransformationMethod on TextView along with PasswordTransformationMethod to display stars.
For my app, I'm trying to get the autocomplete suggestion box to pop up for multiple inputs in the textbox.
For example, let's say the input is "Alice, Bob, Charlie". The user begins to type in "Alice" and selects the name from the suggestions, updating the text view with "Alice, ". Then the user types in "Bob" and the suggestion box pops up again, so the user clicks the name and the text view updates to "Alice, Bob, ". And so on.
The default AutoCompleteTextView in Android doesn't seem to support that kind of functionality of having the suggestions box pop up for each input, only for the first input. How do I go about having the suggestion box pop up for each input?
OK, I figured it out, had to use MultiAutoCompleteTextView instead of AutoCompleteTextView.
I have a few forms that the user has to fill in and I use EditText to enter the information.
the problem is, when the user uses the virtual keyboard there no information about which field he is filling in.
so its fine when there is only one field but when he has 4 or more he fills in the first one, presses next and he has to remember what was the second field and so on
is there a way to set a title in the EditText so that instead of being just a text zone it has a title to remind the user what he is inputing ?
You can add a hint, which pre-fills the EditText with a useful reminder (in a faded-out colour). This disappears when the user starts typing.
android:hint="Type your name here"
Unfortunately the input method editor bits don't let you do that (though that would be nice). Try setting the attribute android:imeOptions="flagNoExtractUi" on the EditText instances.
I want to let users input a postal code to my app. The common use case is the US zip code, which are composed solely of numbers, so I'd like to display the numeric keyboard initially in the soft input. However, not all postal codes are solely digits, so I still need users to be able to enter other characters.
I've been trying to do this with android:inputType, but by setting the "number" flag, it automatically blocks any input except for number-based stuff. Is there a way to just accept general text, but get the soft keyboard to initially display a more number-based keyboard?
Have you tried initially setting the inputType to "number" and then via a TextWatcher changing the input type of the TextView programatically?