edittext

How to replicate android:editable="false" in code?

In the layout you can set the EditText widget to be non-editable via the android:editable attribute. How can I do this in code? I need to make the EditText widget to be editable depending on conditions. ...

How do I show the number keyboard on an EditText in android.

I just basically want to switch to the number pad mode as soon a certain EditText has the focus. ...

How to make android EditText smaller than default in height?

How to make android EditText smaller than default in height? This is the default hight: If I change the height, I can't see my text, but it has extra blank on bottom. check this image: ...

(Android) How do I prevent an EditText from resizing itself when the user is typing?

I have an EditText and a button set next to each other on the same horizontal line. It looks great, except when the user enters a lot of text, the EditText is resized, and the button is squished. I have both EditText and Button set to layout_width="wrap_content". "fill_parent" messes up the layout, and I don't want to use absolute siz...

Android: Can't figure how to use setImeActionLabel

What I want to do is change the default "Done" label that appears in the virtual keyboard. Here's what I've tried without any luck: mSearchInput.setImeOptions(EditorInfo.IME_ACTION_DONE); mSearchInput.setImeActionLabel(getString(R.string.search_action_label), EditorInfo.IME_ACTION_DONE); I am able, however, to handle a click on that b...

Catching key pressed with the virtual keyboard in Android?

With the physical keyboard you can catch key presses with a KeyListener, something like: myEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { /* do something */ } } }); Does anyone know ...

Android EditText boxes

I want to cause the focus of one edit text box to move to another on editting (meaning you can only type on letter before it automatically moves on to the next edit text). It's the "on edit" that I can't get my head around. Can anyone help me out with a simple example? Theres a lot I need to implement it into, so just a basic understand...

android keyboard obscure edittext

In my application, when I click on an EditText view, the virtual keyboard obscures the view, so I can't see my edits. How can I resolves it programmatically ? ...

Android EditText ImeOptions "Done" track finish typing.

I am having edittext field i am setting following property so that i display done button on the kayboard when user click on textfield. editText.setImeOptions(EditorInfo.IME_ACTION_DONE); When user click done button on the screen keyboard(finish typing) i want to change radio button sate, how can i track done done button is hit from sc...

Populate EditText widget text from another EditText widget text

I am trying to populate the text of a second EditText widget with the text from the first EditText widget only when the second EditText widget receives focus, the second widget is not empty, and the first widget is not empty. I have the following OnFocusChangeListener handler code. public void onFocusChange(View v, boolean has...

Edittext set for password with phone number input? (android)

How do I get a Edittext with both a phone input and the ability to hide the string. I know that android:inputType="textPassword" hides the string, while android:inputType="phone" brings up a dialpad interface. How to combine the two? ...

Android question, get selection of text from EditText

I'm trying to implement a copy/paste function. How can I get a selection of text from an EditText? EditText et=(EditText)findViewById(R.id.title); blabla onclicklistener on a button: int startSelection=et.getSelectionStart(); int endSelection=et.getSelectionEnd(); Then I'm stuck. Any ideas? ...

android pan scan mode

When my application is in landscape mode and I selected an edittext, it is edited in full screen mode. Yet I force activity to Pan and Scan adding android:windowSoftInputMode="adjustPan" as an attribute to the Activity element in my xml layout. ...

Programatically scrolling an EditText

I'm writing a simple caesar-encryption-activity. Two EditTexts on screen, one clear-text, one crypted. Here's an example for the crypted EditText - the cleartext one is similar. <EditText android:layout_below="@id/Caesar_Label_CryptText" android:layout_height="wrap_content" android:layout_width="fill_parent" android:id...

how to Remove text onfocus of EditText in android?

I have a scenario, for example, a EditText in acitivity instead of using Textview as a label of it i want to put text "UserName" inside EditText and if user clicks on it. it should disappear and EditText should get empty to enter data in it. How can I achieve this? ...

how to hide keyboard after typing in EditText in android?

dear friends, i have a textbox and button aligned to parent bottom. when i enter text in it and press button to save data. keyboard does not disappear. can any one guide me how to disappear keyboard? any help would be appriciated ...

Android EditText onClickListener

Hi, i want an EditText which creates a DatePicker when is pressed. So i write the next code: mEditInit = (EditText) findViewById(R.id.date_init); mEditInit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showDialog(DATEINIT_DIALOG); } }); But when...

Android: show soft keyboard automatically when focus is on an EditText

I'm showing an input box using AlertDialog. The EditText inside the dialog itself is automatically focused when I call AlertDialog.show(), but the soft keyboard is not automatically shown. How do I make the soft keyboard automatically show when the dialog is shown? (and there is no physical/hardware keyboard). Similar to how when I pres...

Android numeric password field

I have an EditText field which needs to be a numeric password field. Everything works OK in portrait mode; not in landscape. When the user selects the EditText field, the UI zooms into the field and when I type all the characters are visible. I need a numeric keyboard also. I tried setting the input type to text password|number. If I re...

code to edit the text in an EditText widgit

Hello, I am a newbi programmer and am having trouble with a measurement conversion program I am working on. What I would like to do is have several EditText boxes. When one is filled in and a calculate button is hit then the rest will be populated with a converted number. The part I am getting stuck on is outputting the answers to EditTe...