i have several EditText in my App. If you hit the Enter Key you can tab to the next EditText without a problem but i would like to change the Enter Key so that this button doesn't shows the Enter Simbol but instead it shows "Next" or "Done". i tried many things but without any results. Here is the XML code for my EditText:
<EditText
android:id="#+id/et_nt_name"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="top"
android:imeOptions="actionNext|flagNoEnterAction"
android:imeActionLabel="Next"
android:singleLine="true"
android:inputType="textShortMessage"
/>
it is the case that some soft keyboards actually change the default text on the enter key by design, so it may not be your fault that it's not showing what you want it to show. the functionality should be the what you programmed it to do, though.
i recommend you switch to the default keyboard (long press on any edit text, then select input method) to verify that it's showing the correct text, and don't care about the what the other soft keyboards look like .
if your phone didn't come with the default soft keyboard, the Android emulator is your best friend.
Add this to your EditText,
android:imeOptions="actionDone"
Related
Please find below the screenshot wherein the circular box shows the customize button option.
XMl Code:
<EditText
android:id="#+id/et_cost_per_mile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:hint="Cost Per Mile(₤)"
android:inputType="numberSigned"
/>
All I want to remove :: button from keyboard.
You have change input type like..
android:inputType="phone"
You can not. This is your android keyboard app and you cant change it. The keyboard settings can be modified in the android settings. But obviously it depends on the user, not the developer.
The only way I think it will allow you to do that is that you include in your app a fake numeric keypad as a layer (Similar to the keyboard that appears when you have to type the pin of the app of your bank). However, I don't think this is worth it. With...
android:inputType = "numberSigned"
you are already blocking the user from entering letters or other characters, even if they change their keyboard.
In Some phones when number keypad is displayed unable to go back to normal keypad because in my scenario numbers are the primary for me so need number keypad to be displayed at first go later if we want to switch to normal keypad it's not working.
Mostly I observed this issue in Lenovo phones/tablets.
Edit: Basically iam using Digitkeylistener for some seperators to get added programatically if i make use of Textkeylistener its throwing n number crashes randomnly.So I want to use Digitkeylistener but with normal keypad.
Change inputtype attribute of your Edittext in XML, to text
You can add below line in your code
For Numeric,
editText.setRawInputType(Configuration.KEYBOARD_12KEY);
For Qwerty,
editText.setRawInputType(Configuration.KEYBOARD_QWERTY);
This is only to set input type but you can change keyboard and will not restrict Edittext to enter number only.
You can add below line in your XML for getting general keyboard:
android:inputType="text"
<EditText
android:layout_width="match_parent"
android:inputType="text"
android:layout_height="match_parent" />
You can add below line in your XML for getting Number keyboard:
android:inputType="number"
I have a problem with native HTC One keyboard in multilanguage environment.
There is a button on the keyboard which allows to switch the language:
When I enter the text in "plain" EditText this button is enabled, so I can enter text using any language.
However when the inputType=textVisiblePassword is added:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textVisiblePassword" />
the change-the-language button becomes disabled:
Any another keyboard (Swype+Dragon, ...) works ok.
Does anybody know how to fix this problem?
I think for password fields only english language is supported as you need to validate it with server and so.
I use EditText to do input actions, and set android:imeOptions="actionSend" to the widget, so that the soft keyboard can have a send button, but when I click send, the soft keyboard will disappeared, however, it's not friendly to users since user must click EditText again to use the soft keyboard, all I want is to keep the soft keyboard, does any one know how to achieve it?
Here is a piece of my layout code:
<EditText
android:id="#+id/input_area"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="#id/emo_btn"
android:inputType="textAutoCorrect"
android:singleLine="true"
android:imeOptions="actionSend"/>
you are using setOnEditorActionListener or setOnKeyListener ? on both case try your return statement with true
I have a edit text, whose input type is number.
in emulator its working fine i.e, showing the num-pad as soft keypad.
but in the device its showing alphabets keyboard why?
<EditText android:layout_width="110dp"
android:layout_height="30dp" android:id="#+id/phone"
android:layout_alignParentRight="true" android:background="#drawable/edit_text_bg"
android:inputType="number" android:maxLength="10"
android:paddingLeft="4dp" android:textColor="#1b0a00"
android:layout_marginRight="8dp"/>
Thanks in advance....!
So from what i've observed setting the inputType to phone should solve the problem . But try a different device to check if ur code works by giving input as number before moving to this option .
I think you must change inputType
FROM :
android:inputType="number"
TO:
android:inputType="phone"
When you give the InputType as number there is a completely new keyboard that gets loaded very different to what you will get by pressing the corner button on your normal keyboard to get numbers . Only certain phones/android versions(i think 2.2+) have this separate keyboard . For the ones that dont have this , The normal keyboard is shown and manual switching has to be done .
It could be that the device you're testing has some sort of custom keyboard enabled by default that doesn't support a number pad. Try changing the keyboard settings to the standard keyboard on the device and see if it works.