android-edittext

Which theme attribute changes the text color of an EditText's error message

放肆的年华 提交于 2019-11-30 21:42:47
问题 In my form I use setError("") on an EditText field. My Application-Theme extends android:Theme.Holo . I have manually set an image with a dark background for android:errorMessageBackground and android:errorMessageBackgroundAbove . And now here's the problem: The text color of the error message is also very dark and not readable. I tried changing different textColor attributes in my Theme, but I wasn't able to find the correct one. May anyone could help me, please? Thank you! Chris 回答1: You

is it possible multiline with input type as number in Android Edittext?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 21:27:51
When the android edittext input type is number, is it possible to make multilines? I have tried with the following in xml file. android:inputType="number|textMultiLine" But it did not work. Is it not possible to make multiline when the input type is number? Please help me in this. Thank you. Evgeny Maltsev Please do this: android:inputType="textMultiLine|number" android:digits="0,1,2,3,4,5,6,7,8,9" Taken from here: Answer I tried each and every solution for your problem.The thing is that when you try to use android:inputType attribute with number android doesnot provide textMultiLine feature

Android - How to only allow a certain number of decimal places

谁都会走 提交于 2019-11-30 21:22:56
Do you know of any method to make sure users can only enter figures with a maximum number of decimals. I'm not sure how to address this problem. In the MS SQL database I'm going to send data from my app I've got columns with this type decimal(8,3) Now considering the data type of the column that's finally going to store the value I want to validate in Android, I've considered these two cases: If the user enters a number with no decimals, the maximum number of digits must be 8 If the user enters a number with decimals, the maximum number of digits must be 8 (including the digits to the right of

EditText onClick not shows Virtual Keyboard

元气小坏坏 提交于 2019-11-30 20:57:54
If i click on my EditText, the virtual keyboard simple not shows up. The cursor is shown, but no keyboard to type on. I even tried it with manually open but just no works. Here is my code: public class CreateNote extends Activity { EditText titleEdit; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.createnote); titleEdit = (EditText) findViewById(R.id.titleEdit); titleEdit.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { InputMethodManager imm = (InputMethodManager) CreateNote.this

How to delete the last letter from EditText with button? [duplicate]

我只是一个虾纸丫 提交于 2019-11-30 20:49:07
This question already has an answer here: Android EditText - Delete the last letter with a button 4 answers I have to buttons that writes A and B to an edittext. If there is something in the edittext how can I delete the last letters with the "Del" button ? My layout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <Button android:id="@+id/buttonb" android:layout_width="100dp" android:layout_height="100dp" android

How to Prevent Keyboard appearing for EditText that is not enabled

与世无争的帅哥 提交于 2019-11-30 20:43:57
My activity has an EditText which is supposedly not editable until user clicks on edit button for the screen. I did edit.setEnabled(false) but still a keyboard appears for the user and values can be added to the EditText in the screen via the keyboard even though the screen might look a bit greyed out. What else do I have to do to prevent editing of the EditText until user has specifically pushed an edit button. Thanks, Steve Attention that setEditable is depecrated. You can use : setInputType(EditorInfo.TYPE_CLASS_TEXT) To turn keyboard on. setInputType(EditorInfo.TYPE_NULL) To turn keyboard

Problem with android password field, not hiding the last character typed

空扰寡人 提交于 2019-11-30 20:43:12
In Android, I create a password field like this: EditText text = new EditText(context); text.setTransformationMethod(PasswordTransformationMethod.getInstance()); Or like this, which seems to do the same thing: EditText text = new EditText(context); text.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); I get a nice password field except for the last character typed by the user. It's visible on the screen for a few seconds before beeing masked with a dot. Here is a screenshot: Do you know how to fix this behaviour please? Steve Prentice This is expected behavior.

Set focus on spinner when selected in android

风格不统一 提交于 2019-11-30 20:36:13
I have a vertical scrolling layout with multiple EditText and Spinner controls. Problem is when i choose any spinner option after selection the screen scrolls back to the last EditText is was editing before this spinner. The Focus remains with the last EditText i was editing. Is there a way i can keep focus with the current selected spinner. I am looking for a solution that can be implemented on all spinners from layout XML or some generic method to apply to all spinners. Here's my solution. mSpinner.setFocusableInTouchMode(true); mSpinner.setOnFocusChangeListener(new View

How to change the color of a focused EditText when using “android:Theme.Holo.Light”?

落花浮王杯 提交于 2019-11-30 20:28:33
I Am using "android:Theme.Holo.Light" in my application, it gives blue as the Default color. I want to have a EditText when focused like below. By default it comes like this when applying holo.light theme . You can use Holo Color generator for custom colors. http://android-holo-colors.com/ You don't need to download all controls. Only these you want. May this help you: You will have to create/modify your own NinePatch image to replace the default one, and use that as the background of your EditText . If you look in your SDK folder , under your platform, then res/drawable , you should find the

Android XML - moving between EditText fields

元气小坏坏 提交于 2019-11-30 20:23:19
I've got 2 Fragments that have a couple of EditText boxes on. They are both laid out similar, however its very strange that 1 will tab between the EditText fields, but the other won't. This is the one i'm having problems with: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/loginparent" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ff008DFF" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout