Tag: android-edittext

Can't manage to requestFocus a Spinner

I’ve got an annoying issue with a screen. The screen consists of a bunch of Spinners one under the other, and then underneath the spinner, an EditText. The problem is that when the screen starts, the EditText has focus, meaning that some Spinners are off the top of the screen. Try as I might, I […]

Positioning EditText Above Keyboard

I have got an EditText looking like this (with “bottom gravity”): When I press the EditText, the keyboard shows up and I can’t see anymore what I’m typing (because the EditText is now behind the keyboard, on the bottom). How could I move the EditText automatically just above the keyboard, when it has been pressed? […]

How to Handle Enter Key Using TextWatcher on Android

I am working on Android. Previously i used onKeyListener to handle specific action on key event. However, this way seems not to solve my problem since almost all key would get disable once i have implemented that listener to my EditText. After reading some topics in SO, i know that i should use TextWatcher instead, […]

Automatically format phone number in EditText

In my app, the user has to enter a phone number in an EditText field using the following format: 1(515)555-5555 I don’t want the user to type “(“, “)”, or “-” while entering the number; I want these characters to be added automatically. For example, suppose the user typed 1 — the parenthesis after “1” […]

Display a message inside Android Edit Text Field

Hai, I have an Android Program with one text field. I need to display a message inside that textfield when it loads on an emulator. When the user clicks inside that textbox that message should dispappear. For Ex: Please enter name Can any one post some sample code over here…

Show Helper text below EditText along with the Hint

I am trying to make something on these lines: I am able to show the hint using android:hint=”Email Address” but unable to show the helper text – This will be your email username <android.support.design.widget.TextInputLayout android:layout_width=”match_parent” android:layout_height=”wrap_content”> <EditText android:id=”@+id/et_username” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:ems=”15″ android:hint=”Username” app:et_helper=”Username is preferably your registered email”/> </android.support.design.widget.TextInputLayout>` What I am getting is only […]

How to make TextView looks exactly like EditText?

How to make the whole TextView underline at the width of match parent like EditText? This line of code only underlines the text, not the whole TextView. textView.setPaintFlags(textView.getPaintFlags()| Paint.UNDERLINE_TEXT_FLAG); The reason I want to use TextView is that setOnClickListener is triggered immediately in one tap for TextView, whereas two taps are required for a disabled […]

Needing to double click EditText for click listener to respond

I have a section of code where I want to change the text showing in a textView when the user selects an EditText box. The problem I am having is that the textView only changes when I double click the EditText box, one click and there is no change to the textView. Is there another […]

Change Size of EditText bottom border

I have some EditText in my code and I want to make the bottom border of it a bit thinner. Couldn’t find anything about it in the Internet, maybe anyone here can help me with it. What I have: What I want:

EditText stucks after animation and alive back on scrolling…?

I am facing a quite interesting but annoying error, in my linear layout i have hided another linear layout using margin in negative and when user selects a type from a list i bring layout to front using Translational Animation the error is that the layout comes to front have an edit text which becomes […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.