android-edittext

android EditText blends into background

无人久伴 提交于 2019-11-29 02:18:37
My app uses Theme.Holo.Light.DarkActionBar as the parent theme. When I use my Android 3.2 tablet emulator, the EditText shape is almost impossible to see. It looks like it is trying to draw white on white. Seen here: When I use it on my Android 4.0 tablet emulator, the EditText shape looks just fine. You can see the dark grey line along the bottom of the EditText. If you look in the above image, you'll just barely see a white line in the same place as it crosses the light grey background watermark. Here is my EditText in the layout: <EditText android:id="@+id/fieldName" style="@style

Force FullScreen on EditText in Android

自作多情 提交于 2019-11-29 02:03:21
I am currently developing an app with Samsung Galaxy Tab 2 as my device. My Code in the XML is: <EditText android:id="@+id/analysis_text" style="@style/icon_text" android:imeOptions="actionDone" android:inputType="textMultiLine" android:onClick="onBtnClicked" /> When this code executes, the full screen data entry mode (Extract Mode) is triggered automatically only in certain situations. I would like my users to get a full data entry screen while editing text in this control, regardless of the screen or positioning of the control. Another rephrase of this question: How do I force full screen

Converting String to Double in Android

微笑、不失礼 提交于 2019-11-29 02:02:50
问题 Trying to get double values from an EditText and manipulate them before passing them to another Intent. Not using primitive data type so I can use toString methods. Problem is when I include the protein=Double.valueOf(p).doubleValue(); style commands, the program force closes immediately without leaving any info in the logcat.If I comment them out and set some dummy data like protein = 1.0; it works with no problems. Same happens with primitive data types and parse double. This code works

EditText showing numbers with 2 decimals at all times

五迷三道 提交于 2019-11-29 01:55:19
I would like to display the input of the EditText fields with two decimals at all times. So when the user enters 5 it will show 5.00 or when the user enters 7.5 it will show 7.50. Besides that I would like to also show zero when the field is empty instead of nothing. What I've got already is the inputtype set to: android:inputType="number|numberDecimal"/> Should I work with inputfilters here? Sorry I still quite new to android / java... Thanks for your help! Edit 2011-07-09 23.35 - Solved part 1 of 2: The "" to 0.00. With the answer of nickfox I was able to solve half of my question. et

Changing where cursor starts in an expanded EditText

為{幸葍}努か 提交于 2019-11-29 01:51:26
I have TextField that is expanded from its normal single line width and height but the cursor to start typing in the EditText is always in the center of the expanded textfield when I change the height of the textfield and thats where it starts putting text too. How can I get the cursor to the top left corner like normal while still keeping a bigger height box? this is how my box is layout <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="200dp" android:layout_alignParentLeft="true" android:layout_below="@+id/camera_picture" android:layout

Android: Error popup on EditText doesn't move down when keyboard goes away

只谈情不闲聊 提交于 2019-11-29 01:49:50
I have an activity that displays a few EditTexts on screen for user input. To be sure the soft keyboard doesn't cover my fields when it displays I have set the property android:windowSoftInputMode="adjustPan" for my Activity in the manifest. I am validating the EditText's content when 1. The view loses focus 2. When the user performs the 'Enter' action. Upon validation, if the value is not valid I am calling setError(CharSequence error) on the EditText, which causes a popup to display containing the error I passed in. The problem is if the EditText is moved up when the soft keyboard displays,

Remove show password icon in Android N

走远了吗. 提交于 2019-11-29 01:44:40
问题 New Android version automatically draws show password icon when I set android:inputType="textPassword" in EditText view. How can I disable it? Thanks 回答1: The password icon (or eye-icon) use be removed with the method setPasswordVisibilityToggleEnabled or with app:passwordToggleEnabled through XML. For more information see support library revisions. Example: <android.support.design.widget.TextInputLayout android:id="@+id/new_password_layout" android:layout_width="match_parent" android:layout

Format EditText view for phone numbers

北战南征 提交于 2019-11-29 01:30:48
问题 I have an EditText view and I want it to format the user's input into the phone number format. For example, when the user types in 1234567890, the EditText view should dynamically show it as "(123) 456-7890" as soon as the first 3 numbers are inputted. I tried the following in my OnCreate but it didn't seem to do anything for me... EditText ET = (EditText) findViewById(R.id.add_number); ET.addTextChangedListener(new PhoneNumberFormattingTextWatcher()); How can I get the user's input to

Android: Edittext with gravity center not working on device

岁酱吖の 提交于 2019-11-29 01:26:15
In Android I'm using a single line edittext with gravity set to center. In the Emulator this works great both the hint and a blinking cursor shows up. When testing on device (Xperia X10) neither the hint text nor the blinking cursor shows up. The blinking cursor only shows if I enter some text into the edittext. This is my edittext, can anyone see if something is missing? <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_gravity="center" > <EditText android:layout_width="fill_parent" android:layout_height="wrap_content

Label in a editbox in android

纵然是瞬间 提交于 2019-11-29 01:25:47
问题 My question is, how to put a label in a editBox in android ? Like for example, i want to put "To:" in editbox of a contact picker which will not get deleted even if I press backspace on the onscreen keyboard. I tried with android:hint , but it gets deleted when the editBox is focus or clicked. I tried with image but it's not looking good. So, I need a method by which i can implement this label thing. See the visual diagram 回答1: I give you two ideas to do this : If you only need this in a