Tag: android-edittext

How do I handle ImeOptions' done button click?

I am having an EditText where I am setting the following property so that I can display the done button on the keyboard when user click on the EditText. editText.setImeOptions(EditorInfo.IME_ACTION_DONE); When user clicks the done button on the screen keyboard (finished typing) I want to change a RadioButton state. How can I track done button […]

Programmatically change input type of the EditText from PASSWORD to NORMAL & vice versa

In my application, I have an EditText whose default input type is set to android:inputType=”textPassword” by deault. It has a CheckBox to its right, which is when checked, changes the input type of that EditText to NORMAL PLAIN TEXT. Code for that is- password.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); My problem is, when that CheckBox is unchecked it should again […]

How to change the floating label color of TextInputLayout

With reference to the new TextInputLayout released by Google, how do I change the floating label text color? Setting colorControlNormal, colorControlActivated, colorControlHighLight in styles does not help. This is what I have now:

Focusable EditText inside ListView

I’ve spent about 6 hours on this so far, and been hitting nothing but roadblocks. The general premise is that there is some row in a ListView (whether it’s generated by the adapter, or added as a header view) that contains an EditText widget and a Button. All I want to do is be able […]

Android get hosting Activity from a view

I have an Activity with 3 EditTexts and a custom view which acts a specialised keyboard to add information into the EditTexts. Currently I’m passing the Activity into the view so that I can get the currently focused edit text and update the contents from the custom keyboard. Is there a way of referencing the […]

How can i know when a edittext lose focus

I need to catch when an EditText loses focus, I’ve search in users questions but i didn’t find any answer. I use focuschangelistener like this OnFocusChangeListener foco = new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { // TODO Auto-generated method stub } }; But it doesn’t work for me Thanks

Android: Force EditText to remove focus?

This question already has an answer here: Stop EditText from gaining focus at Activity startup 44 answers

how to set only numeric value for edittext in android?

I have an edittext in which I want only integer values to be inserted. Can somebody tell me which property I have to use?

Android: Vertical alignment for multi line EditText (Text area)

I want to have 5 lines for the height of the text area. I am using the following code. <EditText android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:gravity=”center” android:singleLine=”false” android:lines=”5″ android:layout_marginLeft=”10dip” android:layout_marginRight=”10dip” /> The text area looks fine, but the problem is that the cursor is blinking in the middle of the text field. I want it to blink at […]

Android: How can I validate EditText input?

I need to do form input validation on a series of EditTexts. I’m using OnFocusChangeListeners to trigger the validation after the user types into each one, but this doesn’t behave as desired for the last EditText. If I click on the “Done” button while typing into the final EditText then the InputMethod is disconnected, but […]

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