Tag: android-edittext

Android – default value in editText

In my app I have an edit user details page and I want to display the current name, email address etc in the corresponding editText fields and then the user can just erase that and enter a new one if they want. Is there a way to do this? Thanks for any help

Android getText from EditText field

I have a problem with getting text from EditText field to insert it in Email composer with intent. I’ve declared EditText field in layout file (@+id/vnosEmaila): <?xml version=”1.0″ encoding=”utf-8″?> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <TextView android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:id=”@+id/navodiloEmail” android:text=”@string/navodiloEmail” android:textSize=”15dip”/> <EditText android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:id=”@+id/vnosEmaila” android:layout_below=”@id/navodiloEmail”/> <TextView android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:id=”@+id/navodiloZadeva” android:text=”@string/navodiloZadeva” android:layout_below=”@id/vnosEmaila” android:textSize=”15dip”/> <EditText android:layout_width=”fill_parent” android:layout_height=”wrap_content” […]

how to make hint disappear when edittext is touched?

In my application in android are many EditText fields. And I ran into a problem with hint. It is not disappearing when EditText is on tuch, but in disappears when i’m starting to write somathing. How can this problem be fixed? Because I need hint to disappear when the EditText field is touched. It is […]

android how to set the EditText Cursor to the end of its text

This question already has an answer here: Place cursor at the end of text in EditText 16 answers

Displaying soft keyboard whenever AlertDialog.Builder object is opened

My code for opening an input dialog reads as follows: final AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(“Dialog Title”); alert.setMessage(“Request information”); LayoutInflater factory = LayoutInflater.from(this); final View textEntryView = factory.inflate(R.layout.edittextautotextlayout, null); final EditText inputBox = (EditText) textEntryView.findViewById(R.id.my_et_layout); alert.setView(inputBox); This works fine except that I have to tap the text entry line before the soft keyboard appears. […]

How to capture onclick event in disabled EditText in Android App

I have a EditText which I am presenting as disabled so that user cannot edit the contents and also to avoid popping-up keyboard. But now I want to capture onclick event in the EditText and identify the individual words that are being clicked. Any help is most welcome. Thanks, Balkrishna.

android – how to convert int to string and place it in a EditText?

I have this piece of code: ed = (EditText) findViewById (R.id.box); int x = 10; ed.setText (x); It turns out to be an error. I know I have to change it to string, but how do I do this? I’ve tried x.toString(), but it can’t be compiled.

Android – Soft Keyboard pushes layout of my activity out of screen

My activity’s layout is as shown below. <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical”> <FrameLayout android:id=”@+id/title_bar” android:layout_width=”fill_parent” android:layout_height=”25dip” android:background=”@drawable/bg_title” /> <LinearLayout android:id=”@+id/main” android:width=”fill_parent” android:layout_height=”fill_parent” android:layout_weight=”1″> <ListView android:id=”@+id/android:list” android:layout_width=”fill_parent” android:layout_height=”fill_parent” /> <TextView android:id=”@+id/android:empty” android:layout_width=”fill_parent” android:layout_height=”fill_parent” /> </FrameLayout> </LinearLayout> <LinearLayout android:layout_width=”fill_parent” android:layout_height=”50dip” > <EditText android:id=”@+id/query” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:hint=”Enter some search terms” android:singleLine=”true” android:layout_weight=”1″ /> <Button android:id=”@+id/btn_hide” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:background=”@drawable/btn_hide” […]

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?

How to remove the underline from the EditText field in Android?

Whenever a word is typed in the EditText box, I always see an underline under the word being typed. But when I press a space after that word I no longer see the underline. My reqirement is to remove that underline when the user is typing the message. Added is the screenshot and we see […]

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