Tag: android-edittext

How EditText Retains its value but not textview when phone orientation changes?

What is so special about Edittext that it can retain the value but not Textview and some other widgets and we have to use onSavedInstance() method for them. What is the magic behind EditText specially that it can retain the values? If someone can tell how it works internally. <—-Update—-> How it works internally, Please […]

Can I set something like “tooltip” for a view in android?

Can I set some message to appear like a “tooltip” for a TextView or Button?

Android – How to take an EditText (numbers) then convert it to an integer to use it for math?

I am wondering how to take an EditText area that the user can enter a number in, then make it an integer so it can be used in the program for adding, subtracting, dividing, etc. Basicaly I need the test the enter to be able to be used in a calculator which will be within […]

How to disable auto-capitalization of an EditText

This will have a really simple answer, but I can’t seem to find what it is. I want to disable the auto-capitalization of an EditText so that, by default, the first letter entered with not be automatically capitalized. I still want to allow capitalization, but only if the user manually does so. I’ve tried android:capitalize=”none” […]

How to hide keyboard on enter key

i have an activity with four edittext and i want to hide keyboard when users finish to use one of the four edittext. if i click enter on keyboard, it will focus another edittext and keyboard still remain, but i need to hide keyboard, so to use only one edittext and not necessarily the other. […]

How to clear the text in edittext

I want to clear the text in EditText after it has been saved in database. Here is my code: pictureDescription.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable textValue) { String content = textValue.toString(); db.updatePicDes(content,lastSnapId); } }

android edit text how to start typing at the top left?

I have this EditText <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” > <EditText android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:inputType=”textMultiLine” android:lines=”5″ android:singleLine=”false” android:text=”@string/app_name” /> </LinearLayout> My problem is that typing starts at the middle of the EditText. My question is how to start typing at the top left of the EditText?

How to limit EditText length to 7 integers and 2 decimal places?

I have an EditText box which have to allow user to enter upto 7 numbers and two decimal places. After entering seven digits,it should not allow to add one more digit but i may allow upto 2 decimal places. I use a decimal filter for 2 decimal places and this code in XML android:maxLength=”7″ android:imeOptions=”actionDone” […]

How to put two EditText in the same line

I would like to ask you, how can I put two EditText on the same line?

How to extract HTML styled text from an EditText in Android?

I am using HTML.fromHTML(…) to style the text of an EditText in Android. I need to pass the styled text back as a result to another activity. However, when I use an intent to pass the contents of the EditText I am unable to figure out how to retain the HTML style of the original […]

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